mirror of
https://github.com/php/php-src.git
synced 2026-03-27 09:42:22 +01:00
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.
20 lines
367 B
PHP
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]"]
|