]> granicus.if.org Git - php/commitdiff
Added test for bug #38132
authorIlia Alshanetsky <iliaa@php.net>
Wed, 26 Jul 2006 23:32:07 +0000 (23:32 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Wed, 26 Jul 2006 23:32:07 +0000 (23:32 +0000)
ext/reflection/tests/bug38132.phpt [new file with mode: 0755]

diff --git a/ext/reflection/tests/bug38132.phpt b/ext/reflection/tests/bug38132.phpt
new file mode 100755 (executable)
index 0000000..aeb6246
--- /dev/null
@@ -0,0 +1,34 @@
+--TEST--
+Reflection Bug #38132 (ReflectionClass::getStaticProperties() retains \0 in key names)
+--SKIPIF--
+<?php extension_loaded('reflection') or die('skip'); ?>
+--FILE--
+<?php
+class foo {
+       static protected $bar = 'baz';
+       static public $a = 'a';
+}
+
+$class = new ReflectionClass('foo');
+$properties = $class->getStaticProperties();
+var_dump($properties, array_keys($properties));
+var_dump(isset($properties['*bar']));
+var_dump(isset($properties["\0*\0bar"]));
+var_dump(isset($properties["bar"]));
+?>
+--EXPECT--
+array(2) {
+  ["bar"]=>
+  string(3) "baz"
+  ["a"]=>
+  string(1) "a"
+}
+array(2) {
+  [0]=>
+  string(3) "bar"
+  [1]=>
+  string(1) "a"
+}
+bool(false)
+bool(false)
+bool(true)