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/bug73254.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

22 lines
434 B
PHP

--TEST--
Bug #73254 (Incorrect indentation generated by json_encode() with JSON_PRETTY_PRINT)
--SKIPIF--
<?php
if (!extension_loaded('json')) die('skip');
?>
--FILE--
<?php
echo json_encode([json_encode([1], JSON_PRETTY_PRINT)]), "\n";
$fp = fopen('php://temp', 'r');
$data = ['a' => $fp];
echo json_encode($data), "\n";
echo json_encode([json_encode([1], JSON_PRETTY_PRINT)]), "\n";
?>
--EXPECT--
["[\n 1\n]"]
["[\n 1\n]"]