]> granicus.if.org Git - php/commitdiff
add testcase for bug #30833
authorAntony Dovgal <tony2001@php.net>
Wed, 13 Apr 2005 08:23:39 +0000 (08:23 +0000)
committerAntony Dovgal <tony2001@php.net>
Wed, 13 Apr 2005 08:23:39 +0000 (08:23 +0000)
ext/standard/tests/array/bug30833.phpt [new file with mode: 0644]

diff --git a/ext/standard/tests/array/bug30833.phpt b/ext/standard/tests/array/bug30833.phpt
new file mode 100644 (file)
index 0000000..61701a5
--- /dev/null
@@ -0,0 +1,35 @@
+--TEST--
+bug #30833 (array_count_values() modifying input array)
+--FILE--
+<?php
+
+$foo = array('abc', '0000');
+var_dump($foo);
+
+$count = array_count_values( $foo );
+var_dump($count);
+
+var_dump($foo);
+
+echo "Done\n";
+?>
+--EXPECT--     
+array(2) {
+  [0]=>
+  string(3) "abc"
+  [1]=>
+  string(4) "0000"
+}
+array(2) {
+  ["abc"]=>
+  int(1)
+  [0]=>
+  int(1)
+}
+array(2) {
+  [0]=>
+  string(3) "abc"
+  [1]=>
+  string(4) "0000"
+}
+Done