This conditional code execution if statement is right out of the php manual:
// version_compare ( string $version1 , string $version2 [, string $operator ] )
// http://php.net/manual/en/function.version-compare.php
if (version_compare(PHP_VERSION, '5.3.0') >= 0)
{
//echo 'I am at least PHP version 5.3.0, my version: ' . PHP_VERSION . "
";
include_once( DOMAIN_PATH . "sitewide/functions/make_comparer.php" );
usort($market_and_volume, make_comparer(['exchange_volume', SORT_DESC], ['exchange', SORT_DESC]));
}
The above code runs free of error on the production server. On localhost php version 5.2.9-2 which theoretically fails the version_compare() function it throws an error:
Parse error: parse error, expecting `')'' in test.php on line 61
Normally i might not care since its running on the 5.4.39 production server, however I plan to use this snippet on almost every localhost page which as it stands would impede future development.
Any ideas?