Skip to content

Commit 8307ab1

Browse files
committed
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`.
1 parent c8be676 commit 8307ab1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Encoder/JsonDecode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public function decode($data, $format, array $context = array())
9292
$recursionDepth = $context['json_decode_recursion_depth'];
9393
$options = $context['json_decode_options'];
9494

95-
if (version_compare(PHP_VERSION, '5.4.0') >= 0) {
95+
if (PHP_VERSION_ID >= 50400) {
9696
$decodedData = json_decode($data, $associative, $recursionDepth, $options);
9797
} else {
9898
$decodedData = json_decode($data, $associative, $recursionDepth);

0 commit comments

Comments
 (0)