]> granicus.if.org Git - php/commitdiff
- New test
authorFelipe Pena <felipe@php.net>
Thu, 2 Oct 2008 03:31:27 +0000 (03:31 +0000)
committerFelipe Pena <felipe@php.net>
Thu, 2 Oct 2008 03:31:27 +0000 (03:31 +0000)
ext/json/tests/bug46215.phpt [new file with mode: 0644]

diff --git a/ext/json/tests/bug46215.phpt b/ext/json/tests/bug46215.phpt
new file mode 100644 (file)
index 0000000..da3344f
--- /dev/null
@@ -0,0 +1,23 @@
+--TEST--
+Bug #46215 (json_encode mutates its parameter and has some class-specific state)
+--FILE--
+<?php
+
+class foo {
+    protected $a = array();
+}
+
+$a = new foo;
+$x = json_encode($a);
+
+print_r($a);
+
+?>
+--EXPECT--
+foo Object
+(
+    [a:protected] => Array
+        (
+        )
+
+)