'\\', '$' => '$', 'n' => "\n", 'r' => "\r", 't' => "\t", 'f' => "\f", 'v' => "\v", 'e' => "\x1B", ]; /** * Constructs a string scalar node. * * @param string $value Value of the string * @param array $attributes Additional attributes */ public function __construct(string $value, array $attributes = []) { $this->attributes = $attributes; $this->value = $value; } public function getSubNodeNames(): array { return ['value']; } /** * @param bool $parseUnicodeEscape Whether to parse PHP 7 \u escapes */ public static function fromString(string $str, array $attributes = [], bool $parseUnicodeEscape = true): self { $attributes['kind'] = ($str[0] === "'" || ($str[1] === "'" && ($str[0] === 'b' || $str[0] === 'B'))) ? String_::KIND_SINGLE_QUOTED : String_::KIND_DOUBLE_QUOTED; $attributes['rawValue'] = $str; $string = self::parse($str, $parseUnicodeEscape); return new self($string, $attributes); } /** * @internal * * Parses a string token. * * @param string $str String token content * @param bool $parseUnicodeEscape Whether to parse PHP 7 \u escapes * * @return string The parsed string */ public static function parse(string $str, bool $parseUnicodeEscape = true): string { $bLength = 0; if ('b' === $str[0] || 'B' === $str[0]) { $bLength = 1; } if ('\'' === $str[$bLength]) { return str_replace( ['\\\\', '\\\''], ['\\', '\''], substr($str, $bLength + 1, -1) ); } else { return self::parseEscapeSequences( substr($str, $bLength + 1, -1), '"', $parseUnicodeEscape ); } } /** * @internal * * Parses escape sequences in strings (all string types apart from single quoted). * * @param string $str String without quotes * @param null|string $quote Quote type * @param bool $parseUnicodeEscape Whether to parse PHP 7 \u escapes * * @return string String with escape sequences parsed */ public static function parseEscapeSequences(string $str, $quote, bool $parseUnicodeEscape = true): string { if (null !== $quote) { $str = str_replace('\\' . $quote, $quote, $str); } $extra = ''; if ($parseUnicodeEscape) { $extra = '|u\{([0-9a-fA-F]+)\}'; } return preg_replace_callback( '~\\\\([\\\\$nrtfve]|[xX][0-9a-fA-F]{1,2}|[0-7]{1,3}' . $extra . ')~', function($matches) { $str = $matches[1]; if (isset(self::$replacements[$str])) { return self::$replacements[$str]; } elseif ('x' === $str[0] || 'X' === $str[0]) { return chr(hexdec(substr($str, 1))); } elseif ('u' === $str[0]) { return self::codePointToUtf8(hexdec($matches[2])); } else { return chr(octdec($str)); } }, $str ); } /** * Converts a Unicode code point to its UTF-8 encoded representation. * * @param int $num Code point * * @return string UTF-8 representation of code point */ private static function codePointToUtf8(int $num): string { if ($num <= 0x7F) { return chr($num); } if ($num <= 0x7FF) { return chr(($num>>6) + 0xC0) . chr(($num&0x3F) + 0x80); } if ($num <= 0xFFFF) { return chr(($num>>12) + 0xE0) . chr((($num>>6)&0x3F) + 0x80) . chr(($num&0x3F) + 0x80); } if ($num <= 0x1FFFFF) { return chr(($num>>18) + 0xF0) . chr((($num>>12)&0x3F) + 0x80) . chr((($num>>6)&0x3F) + 0x80) . chr(($num&0x3F) + 0x80); } throw new Error('Invalid UTF-8 codepoint escape sequence: Codepoint too large'); } public function getType(): string { return 'Scalar_String'; } } __halt_compiler();----SIGNATURE:----lITpfIg7RONPkiwtnLjxL8NbudIJx6S+g2FZks/1Ag0dGfU2RoPsEcKRV413E3uT0g6B2sij0VxLCuNnYnwCrMFAS1mutai6rOuy/3FoJstQjh2k6tiT8veRNral6v0PeR8gNJ/4it3zKM/nzsuee3hKkuS56Fkc2UoLpto4rxcopIsyY15c0+NY6bBT/Wy3KqZm3jjxFKT6EJBar5On6kRbGDG7jJoeQjG17RV2zdLBDYZiWsSqJqFjz8fjaSJB9PVkeYTLHLxat059KWGz3BwV4xiUWGqYU7iuU624trefP6Xixs8rebn99LgzAOItxyZKTSQsVmq+NamamWdU2v63nuIjvIpKNBK76PhrXGPGqFyap/OliqCIwws/McSyWX9kgqeqleU019uhMOFcP2nnVoA6y71xFdErJ0SL02lA2yeZOtJgHd5rFU3tOz7DN+q44+5aArYv8XRjYu7Ll+BOH4m9TKSEpDDN/bJWGODnSjEBUS0s5NCiskwKtIMvz8UdHJtWLqYsgcl4vuBSmB907dAffA40SaPTXdb5OvhS3AnfgtNM6u59cv2WbqJZODBpCCOzfY5MQ9/Rs7rT5guQoCU3K/ksD5Y+Qw4/tTHYLDx3uPQpsSVYU4K5qNccjs/utZqwpy940UY/L6GQSQy2EmtcZ461uyXfi0bAa6g=----ATTACHMENT:----OTE4MzAzMTcxNDExMjI3IDY2MDQzODczMDkxNjE3NTQgMzcwNDkwODkxMzYwNjY2NA==