xref: /PHP-7.2/ext/reflection/tests/bug38132.phpt (revision 610c7fbe)
1--TEST--
2Reflection Bug #38132 (ReflectionClass::getStaticProperties() retains \0 in key names)
3--FILE--
4<?php
5class foo {
6	static protected $bar = 'baz';
7	static public $a = 'a';
8}
9
10$class = new ReflectionClass('foo');
11$properties = $class->getStaticProperties();
12var_dump($properties, array_keys($properties));
13var_dump(isset($properties['*bar']));
14var_dump(isset($properties["\0*\0bar"]));
15var_dump(isset($properties["bar"]));
16?>
17--EXPECT--
18array(2) {
19  ["bar"]=>
20  string(3) "baz"
21  ["a"]=>
22  string(1) "a"
23}
24array(2) {
25  [0]=>
26  string(3) "bar"
27  [1]=>
28  string(1) "a"
29}
30bool(false)
31bool(false)
32bool(true)
33