src/AbstractJsonEncoder.php
private function getJsonErrorName($error)
    {
        $matches = array_keys(get_defined_constants(), $error, true);
        $prefix = 'JSON_ERROR_';
        $prefixLength = strlen($prefix);
        $name = 'UNKNOWN_ERROR';

        foreach ($matches as $match) {
            if (is_string($match) && strncmp($match, $prefix, $prefixLength) === 0) {
                $name = $match;
                break;
            }
        }

        return $name;
    }
private function getJsonErrorName($error)
    {
        $matches = array_keys(get_defined_constants(), $error, true);
        $prefix = 'JSON_ERROR_';
        $prefixLength = strlen($prefix);
        $name = 'UNKNOWN_ERROR';

        foreach ($matches as $match) {
            if (is_string($match) && strncmp($match, $prefix, $prefixLength) === 0) {
                $name = $match;
                break;
            }
        }

        return $name;
    }
private function getJsonErrorName ( $ error ) { $ matches = array_keys ( get_defined_constants ( ) , $ error , true ) ; $ prefix = 'JSON_ERROR_' ; $ prefixLength = strlen ( $ prefix ) ; $ name = 'UNKNOWN_ERROR' ; foreach ( $ matches as $ match ) { if ( is_string ( $ match ) && strncmp ( $ match , $ prefix , $ prefixLength ) === 0 ) { $ name = $ match ; break ; } } return $ name ; }
Returns the name of the JSON error constant.
@param int $error The error code to find
@return string The name for the error code
Returns the name of the JSON error constant .