From d2c0baba026f4df34bfad76aeea0e28878cfb2bf Mon Sep 17 00:00:00 2001 From: Erayd Date: Wed, 5 Apr 2017 20:04:39 +1200 Subject: [PATCH] Use function_exists to allow polyfill compatibility --- src/JsonSchema/Constraints/BaseConstraint.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/JsonSchema/Constraints/BaseConstraint.php b/src/JsonSchema/Constraints/BaseConstraint.php index e620aec3..13168d71 100644 --- a/src/JsonSchema/Constraints/BaseConstraint.php +++ b/src/JsonSchema/Constraints/BaseConstraint.php @@ -146,7 +146,7 @@ public static function arrayToObjectRecursive($array) $json = json_encode($array); if (json_last_error() !== \JSON_ERROR_NONE) { $message = 'Unable to encode schema array as JSON'; - if (version_compare(phpversion(), '5.5.0', '>=')) { + if (function_exists('json_last_error_msg')) { $message .= ': ' . json_last_error_msg(); } throw new InvalidArgumentException($message);