Skip to content

Commit

Permalink
Use function_exists to allow polyfill compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
erayd committed Apr 5, 2017
1 parent 9119798 commit d2c0bab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/JsonSchema/Constraints/BaseConstraint.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d2c0bab

Please sign in to comment.