You are here

public function JsonDecode::getLastError in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/serializer/Encoder/JsonDecode.php \Symfony\Component\Serializer\Encoder\JsonDecode::getLastError()

Returns the last decoding error (if any).

Return value

int

Deprecated

since version 2.5, to be removed in 3.0. The {@self decode()} method throws an exception if error found.

See also

http://php.net/manual/en/function.json-last-error.php json_last_error

File

vendor/symfony/serializer/Encoder/JsonDecode.php, line 62

Class

JsonDecode
Decodes JSON data.

Namespace

Symfony\Component\Serializer\Encoder

Code

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;
}