1
0
mirror of https://github.com/php/php-src.git synced 2026-03-26 09:12:14 +01:00
Files
archived-php-src/ext/json/tests/bug62010.phpt
Juan Morales b80ffc5b2e Json last error msg/error message with location error (#20629)
This slightly extend error messages with locations taken from scanner / parser
2026-01-03 18:34:19 +01:00

14 lines
312 B
PHP

--TEST--
Bug #62010 (json_decode produces invalid byte-sequences)
--FILE--
<?php
var_dump(json_decode('"\ud834"'));
var_dump(json_last_error() === JSON_ERROR_UTF16);
var_dump(json_last_error_msg());
?>
--EXPECT--
NULL
bool(true)
string(68) "Single unpaired UTF-16 surrogate in unicode escape near location 1:1"