summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Flothmann <christian.flothmann@gmail.com>2014-11-17 15:32:09 +0100
committerChristian Flothmann <christian.flothmann@gmail.com>2014-11-17 17:27:42 +0100
commitd8cc62d21112242ee8e0420318fad23213b9e94a (patch)
treef9a33feb362ae18219f9bbd6946d6a96e498c693
parent8608718ea659ba359063ee0e8d4ea2f3ad97b661 (diff)
downloadsymfony-security-d8cc62d21112242ee8e0420318fad23213b9e94a.zip
symfony-security-d8cc62d21112242ee8e0420318fad23213b9e94a.tar.gz
symfony-security-d8cc62d21112242ee8e0420318fad23213b9e94a.tar.bz2
compare version using PHP_VERSION_ID
To let opcode caches optimize cached code, the `PHP_VERSION_ID` constant is used to detect the current PHP version instead of calling `version_compare()` with `PHP_VERSION`.
-rw-r--r--Core/Util/SecureRandom.php2
-rw-r--r--Tests/Core/Encoder/BCryptPasswordEncoderTest.php2
2 files changed, 2 insertions, 2 deletions
diff --git a/Core/Util/SecureRandom.php b/Core/Util/SecureRandom.php
index 841b9af..aefc888 100644
--- a/Core/Util/SecureRandom.php
+++ b/Core/Util/SecureRandom.php
@@ -43,7 +43,7 @@ final class SecureRandom implements SecureRandomInterface
$this->logger = $logger;
// determine whether to use OpenSSL
- if (defined('PHP_WINDOWS_VERSION_BUILD') && version_compare(PHP_VERSION, '5.3.4', '<')) {
+ if (defined('PHP_WINDOWS_VERSION_BUILD') && PHP_VERSION_ID < 50304) {
$this->useOpenSsl = false;
} elseif (!function_exists('openssl_random_pseudo_bytes')) {
if (null !== $this->logger) {
diff --git a/Tests/Core/Encoder/BCryptPasswordEncoderTest.php b/Tests/Core/Encoder/BCryptPasswordEncoderTest.php
index dd962fd..61e2afe 100644
--- a/Tests/Core/Encoder/BCryptPasswordEncoderTest.php
+++ b/Tests/Core/Encoder/BCryptPasswordEncoderTest.php
@@ -66,7 +66,7 @@ class BCryptPasswordEncoderTest extends \PHPUnit_Framework_TestCase
private function skipIfPhpVersionIsNotSupported()
{
- if (version_compare(phpversion(), '5.3.7', '<')) {
+ if (PHP_VERSION_ID < 50307) {
$this->markTestSkipped('Requires PHP >= 5.3.7');
}
}