Different functions and options are always being added to PHP. Although new versions generally don't create much backward compatibility issues it is usually prudent to write production code that you know will work on servers running a slightly older version of the language.
To check the currently used PHP version you can use the function phpversion() or the constant PHP_VERSION. Both the function and the constant return a string that contains the version number. There are a couple of ways in which this information can be used, the first is to take the string and convert into an array using the explode() function. With this array you can then check the minor version number and run code like the following: