xref: /PHP-7.4/ext/json/tests/bug46215.phpt (revision e5abc537)
1--TEST--
2Bug #46215 (json_encode mutates its parameter and has some class-specific state)
3--SKIPIF--
4<?php if (!extension_loaded("json")) print "skip"; ?>
5--FILE--
6<?php
7
8class foo {
9	protected $a = array();
10}
11
12$a = new foo;
13$x = json_encode($a);
14
15print_r($a);
16
17?>
18--EXPECT--
19foo Object
20(
21    [a:protected] => Array
22        (
23        )
24
25)
26