$this->recursionDepth = (int) $depth;
}
- /**
- * Returns the last decoding error (if any).
- *
- * @return int
- *
- * @deprecated since version 2.5, to be removed in 3.0.
- * The {@self decode()} method throws an exception if error found.
- * @see http://php.net/manual/en/function.json-last-error.php json_last_error
- */
- public function getLastError()
- {
- @trigger_error('The '.__METHOD__.' method is deprecated since version 2.5 and will be removed in 3.0. Catch the exception raised by the decode() method instead to get the last JSON decoding error.', E_USER_DEPRECATED);
-
- return $this->lastError;
- }
-
/**
* Decodes data.
*
$recursionDepth = $context['json_decode_recursion_depth'];
$options = $context['json_decode_options'];
- if (\PHP_VERSION_ID >= 50400) {
- $decodedData = json_decode($data, $associative, $recursionDepth, $options);
- } else {
- $decodedData = json_decode($data, $associative, $recursionDepth);
- }
+ $decodedData = json_decode($data, $associative, $recursionDepth, $options);
if (JSON_ERROR_NONE !== $this->lastError = json_last_error()) {
throw new UnexpectedValueException(json_last_error_msg());