src/Peach/DF/JsonCodec/StringExpr.php
private function decodeEscapedChar(Context $context)
    {
        // @codeCoverageIgnoreStart
        static $specials = null;
        if ($specials === null) {
            $specials = array("\\" => "\\", '"' => '"', "/" => "/", "b" => chr(0x8), "f" => chr(0xC), "n" => "\n", "r" => "\r", "t" => "\t");
        }
        // @codeCoverageIgnoreEnd
        
        $current = $context->current();
        if (array_key_exists($current, $specials)) {
            $context->next();
            return $specials[$current];
        }
        
        // decode \uXXXX
        if ($current !== "u") {
            throw $context->createException("Invalid escape sequence ('\\{$current}')");
        }
        $context->next();
        $hex = $context->getSequence(4);
        if (!preg_match("/^[0-9A-Fa-f]{4}$/", $hex)) {
            throw $context->createException("Invalid hexadecimal sequence (Expected: \\uXXXX)");
        }
        $context->skip(4);
        return $context->encodeCodepoint(hexdec($hex));
    }
private function decodeEscapedChar(Context $context)
    {
        // @codeCoverageIgnoreStart
        static $specials = null;
        if ($specials === null) {
            $specials = array("\\" => "\\", '"' => '"', "/" => "/", "b" => chr(0x8), "f" => chr(0xC), "n" => "\n", "r" => "\r", "t" => "\t");
        }
        // @codeCoverageIgnoreEnd
        
        $current = $context->current();
        if (array_key_exists($current, $specials)) {
            $context->next();
            return $specials[$current];
        }
        
        // decode \uXXXX
        if ($current !== "u") {
            throw $context->createException("Invalid escape sequence ('\\{$current}')");
        }
        $context->next();
        $hex = $context->getSequence(4);
        if (!preg_match("/^[0-9A-Fa-f]{4}$/", $hex)) {
            throw $context->createException("Invalid hexadecimal sequence (Expected: \\uXXXX)");
        }
        $context->skip(4);
        return $context->encodeCodepoint(hexdec($hex));
    }
private function decodeEscapedChar ( Context $ context ) { // @codeCoverageIgnoreStart static $ specials = null ; if ( $ specials === null ) { $ specials = array ( "\\" => "\\" , '"' => '"' , "/" => "/" , "b" => chr ( 0x8 ) , "f" => chr ( 0xC ) , "n" => "\n" , "r" => "\r" , "t" => "\t" ) ; } // @codeCoverageIgnoreEnd $ current = $ context -> current ( ) ; if ( array_key_exists ( $ current , $ specials ) ) { $ context -> next ( ) ; return $ specials [ $ current ] ; } // decode \uXXXX if ( $ current !== "u" ) { throw $ context -> createException ( "Invalid escape sequence ('\\{$current}')" ) ; } $ context -> next ( ) ; $ hex = $ context -> getSequence ( 4 ) ; if ( ! preg_match ( "/^[0-9A-Fa-f]{4}$/" , $ hex ) ) { throw $ context -> createException ( "Invalid hexadecimal sequence (Expected: \\uXXXX)" ) ; } $ context -> skip ( 4 ) ; return $ context -> encodeCodepoint ( hexdec ( $ hex ) ) ; }
"\" で始まる文字列を対応する文字に変換します.

@param  Context $context
@return string
\ で始まる文字列を対応する文字に変換します .