PHP version detection bug

Using

PHP 5.4.0 with 5.6.0 Zend Server Community Edition.

Yii can not be installed. Look at requirements\requirements.php line 12:

‘condition’ => version_compare(PHP_VERSION, ‘5.4.0’, ‘>=’)

test Script:

<?php

echo PHP_VERSION;

echo “\r\nCompare: “.version_compare(PHP_VERSION, ‘5.4.0’, ‘>=’).”\r\n”;

if (version_compare(PHP_VERSION, ‘6.0.0’) >= 0) {

echo 'Using equal or gt  6.0.0, version: ' . PHP_VERSION . &quot;&#092;n&quot;;

}

if (version_compare(PHP_VERSION, ‘5.3.0’) >= 0) {

echo 'Using equal or gt  5.3.0, version: ' . PHP_VERSION . &quot;&#092;n&quot;;

}

if (version_compare(PHP_VERSION, ‘5.4.0’) >= 0) {

echo 'Using equal or gt  5.4.0, version: ' . PHP_VERSION . &quot;&#092;n&quot;;

}

if (version_compare(PHP_VERSION, ‘5.0.0’, ‘>=’)) {

echo 'Using  PHP 5, version: ' . PHP_VERSION . &quot;&#092;n&quot;;

}

if (version_compare(PHP_VERSION, ‘5.0.0’, ‘<’)) {

echo 'Using PHP 4, version: ' . PHP_VERSION . &quot;&#092;n&quot;;

}

Result:

5.4.0-ZS5.6.0

Compare:

Using equal or gt 5.3.0, version: 5.4.0-ZS5.6.0

Using PHP 5, version: 5.4.0-ZS5.6.0

[size="7"]How can this be?![/size]

Well, you are right. For version_compare() 5.4.0-ZS5.6.0 version is lower than 5.4.0.

The real question is: is this 5.4.0-ZS5.6.0 version enough to run Yii 2 or not?

Anyway you should stop using 5.4. Active support ended 9 months ago, and security support lasts for only 2 months more.

Thank you.