1
0
mirror of https://github.com/php/php-src.git synced 2026-03-27 01:32:22 +01:00
Files
archived-php-src/ext/json/tests/bug66025.phpt
Jakub Zelenka c34de0b61c Introduce json encoder to fix globals related issues
It fixes bugs #66025 and #73254 by replacing globals with
a passed structure holding depth and error code. In addition
it fixes #72069 in a more generic way.
2016-10-30 13:20:10 +00:00

20 lines
367 B
PHP

--TEST--
Bug #66025 (Indent wrong when json_encode() called from jsonSerialize function)
--SKIPIF--
<?php
if (!extension_loaded('json')) die('skip');
?>
--FILE--
<?php
class Foo implements JsonSerializable {
public function jsonSerialize() {
return json_encode([1], JSON_PRETTY_PRINT);
}
}
echo json_encode([new Foo]), "\n";
?>
--EXPECT--
["[\n 1\n]"]