Are there any potential issues or drawbacks to using phpinfo() to check the PHP version?

One potential issue with using phpinfo() to check the PHP version is that it may expose sensitive information about your server configuration to potential attackers. To mitigate this risk, you can create a simple PHP script that only displays the PHP version without revealing other details.

<?php
echo 'PHP Version: ' . phpversion();
?>