PHP

HOW TO CHECK THE PHP VERSION

Simply run php -v in the command line.

2

Create a single-line script with phpinfo(); and open it in the browser.

COMMAND LINE CHECK

01

PHPINFO FUNCTION

02

echo PHP_VERSION; echo PHP_MAJOR_VERSION; echo PHP_MINOR_VERSION;

echo phpversion();

VERSION CONSTANTS

03

VERSION FUNCTION

04

if (PHP_INT_SIZE==4) { echo "32 bits"; } if (PHP_INT_SIZE==8) { echo "64 bits"; }

32 OR 64 BITS PHP

05

THREAD SAFE CHECK

06

echo ZEND_THREAD_SAFE ? "Thread safe" : "Not thread safe";