Ouzo\Utilities\Json::lastError PHP Method

lastError() public static method

Returns a JSON error code for the last operation.
public static lastError ( ) : integer
return integer
    public static function lastError()
    {
        return json_last_error();
    }

Usage Example

Beispiel #1
0
 /**
  * @test
  */
 public function shouldResetJsonError()
 {
     //given
     Json::safeDecode("error");
     Json::safeDecode("");
     //when
     $error = Json::lastError();
     //then
     $this->assertEquals(JSON_ERROR_NONE, $error);
 }