Closed
Description
Description
The following code:
const char* name = "Foo\\Bar\\BAZ";
zend_register_long_constant(name, strlen(name), 42, CONST_CS|CONST_PERSISTENT, module_number);
$re = new \ReflectionExtension('my_extension');
var_dump($re->getConstants());
Resulted in this output:
array(1) {
["foo\bar\BAZ"]=>
int(42)
}
But I expected this output instead:
array(1) {
["Foo\Bar\BAZ"]=>
int(42)
}
This also affects user-defined constants, see #11423 (comment).
This behaviour was introduced in php 8.3 by the removal of the name
field of the zend_constant
struct in f42992f (#10954).
PHP Version
PHP 8.3-dev
Operating System
irrelevant