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