Skip to content

Commit 02d04c6

Browse files
committed
JSON_ERROR_INVALID_PROPERTY_NAME is php 7.0+
1 parent 9a0df6b commit 02d04c6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/Debug/Utility/StringUtil.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ public static function prettyJson($json, $encodeFlags = 0, $encodeFlagsAdd = JSO
312312
$flags |= JSON_UNESCAPED_UNICODE;
313313
}
314314
$decoded = \json_decode($json);
315-
if (\json_last_error() === JSON_ERROR_INVALID_PROPERTY_NAME) {
315+
if (\defined('JSON_ERROR_INVALID_PROPERTY_NAME') && \json_last_error() === JSON_ERROR_INVALID_PROPERTY_NAME) {
316316
$decoded = \json_decode($json, true);
317317
}
318318
return \json_last_error() === JSON_ERROR_NONE

0 commit comments

Comments
 (0)