Newer PHP versions come with more features and improvements while deprecating some obsolete features. Old PHP codes might not work with more recent PHP versions and vice versa. It is, therefore, essential to use the correct PHP version for your code. Show
You can check the PHP version on your system by running the php command from the command line. There are also some PHP functions that you can use in your code to get the PHP version during runtime. php binary is available in default PATH variable for Ubuntu and other Linux variance if installed using the default package manager. You might need to use full path for the binary if it's manually installed or using other methods such as XAMPP for Windows. Steps to check installed PHP version:
|