diff --git a/src/Symfony/Bridge/Twig/Tests/Node/DumpNodeTest.php b/src/Symfony/Bridge/Twig/Tests/Node/DumpNodeTest.php index 2553b9ea2ab4..5d8ea6f0868a 100644 --- a/src/Symfony/Bridge/Twig/Tests/Node/DumpNodeTest.php +++ b/src/Symfony/Bridge/Twig/Tests/Node/DumpNodeTest.php @@ -80,7 +80,7 @@ public function testOneVar() } EOTXT; - $expected = preg_replace('/%(.*?)%/', version_compare(PHP_VERSION, '5.4.0') >= 0 ? '(isset($context["$1"]) ? $context["$1"] : null)' : '$this->getContext($context, "$1")', $expected); + $expected = preg_replace('/%(.*?)%/', PHP_VERSION_ID >= 50400 ? '(isset($context["$1"]) ? $context["$1"] : null)' : '$this->getContext($context, "$1")', $expected); $this->assertSame($expected, $compiler->compile($node)->getSource()); } @@ -106,7 +106,7 @@ public function testMultiVars() } EOTXT; - $expected = preg_replace('/%(.*?)%/', version_compare(PHP_VERSION, '5.4.0') >= 0 ? '(isset($context["$1"]) ? $context["$1"] : null)' : '$this->getContext($context, "$1")', $expected); + $expected = preg_replace('/%(.*?)%/', PHP_VERSION_ID >= 50400 ? '(isset($context["$1"]) ? $context["$1"] : null)' : '$this->getContext($context, "$1")', $expected); $this->assertSame($expected, $compiler->compile($node)->getSource()); } diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/ServerCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/ServerCommand.php index 32f749f79f66..b979a19f0f73 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/ServerCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/ServerCommand.php @@ -23,7 +23,7 @@ abstract class ServerCommand extends ContainerAwareCommand */ public function isEnabled() { - if (version_compare(phpversion(), '5.4.0', '<') || defined('HHVM_VERSION')) { + if (PHP_VERSION_ID < 50400 || defined('HHVM_VERSION')) { return false; } diff --git a/src/Symfony/Component/Validator/Tests/Constraints/AbstractComparisonValidatorTestCase.php b/src/Symfony/Component/Validator/Tests/Constraints/AbstractComparisonValidatorTestCase.php index fb85315b3334..aa111a37f3d5 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/AbstractComparisonValidatorTestCase.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/AbstractComparisonValidatorTestCase.php @@ -36,7 +36,7 @@ abstract class AbstractComparisonValidatorTestCase extends AbstractConstraintVal { protected static function addPhp5Dot5Comparisons(array $comparisons) { - if (version_compare(PHP_VERSION, '5.5.0-dev', '<')) { + if (PHP_VERSION_ID < 50500) { return $comparisons; } diff --git a/src/Symfony/Component/Validator/Tests/Constraints/IdenticalToValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/IdenticalToValidatorTest.php index 4b71062f0593..ef0c6f177aef 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/IdenticalToValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/IdenticalToValidatorTest.php @@ -64,7 +64,7 @@ public function provideValidComparisons() array(null, 1), ); - if (version_compare(PHP_VERSION, '>=', '5.5')) { + if (PHP_VERSION_ID => 50500) { $immutableDate = new \DateTimeImmutable('2000-01-01'); $comparisons[] = array($immutableDate, $immutableDate); } diff --git a/src/Symfony/Component/Validator/Tests/Constraints/RangeValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/RangeValidatorTest.php index 9b7056b54873..b43cc20d3c9f 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/RangeValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/RangeValidatorTest.php @@ -194,7 +194,7 @@ public function getTenthToTwentiethMarch2014() array(new \DateTime('March 20, 2014')), ); - if (version_compare(PHP_VERSION, '5.5.0-dev', '>=')) { + if (PHP_VERSION_ID >= 50500) { $tests[] = array(new \DateTimeImmutable('March 10, 2014')); $tests[] = array(new \DateTimeImmutable('March 15, 2014')); $tests[] = array(new \DateTimeImmutable('March 20, 2014')); @@ -216,7 +216,7 @@ public function getSoonerThanTenthMarch2014() array(new \DateTime('March 9, 2014'), 'Mar 9, 2014, 12:00 AM'), ); - if (version_compare(PHP_VERSION, '5.5.0-dev', '>=')) { + if (PHP_VERSION_ID >= 50500) { $tests[] = array(new \DateTimeImmutable('March 20, 2013'), 'Mar 20, 2013, 12:00 AM'); $tests[] = array(new \DateTimeImmutable('March 9, 2014'), 'Mar 9, 2014, 12:00 AM'); } @@ -237,7 +237,7 @@ public function getLaterThanTwentiethMarch2014() array(new \DateTime('March 9, 2015'), 'Mar 9, 2015, 12:00 AM'), ); - if (version_compare(PHP_VERSION, '5.5.0-dev', '>=')) { + if (PHP_VERSION_ID >= 50500) { $tests[] = array(new \DateTimeImmutable('March 21, 2014'), 'Mar 21, 2014, 12:00 AM'); $tests[] = array(new \DateTimeImmutable('March 9, 2015'), 'Mar 9, 2015, 12:00 AM'); }