1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Add test for GH-11423

This commit is contained in:
Máté Kocsis
2023-06-15 01:06:29 +02:00
parent 85a4a80da3
commit 96ea06a1d9

View File

@@ -0,0 +1,29 @@
--TEST--
GH-11423 (internal constants have their namespace lowercased)
--EXTENSIONS--
zend_test
--FILE--
<?php
$re = new \ReflectionExtension('zend_test');
var_dump($re->getConstants());
define('NS1\ns2\Const1','value1');
var_dump(get_defined_constants(true)["user"]);
?>
--EXPECT--
array(4) {
["ZEND_TEST_DEPRECATED"]=>
int(42)
["ZEND_CONSTANT_A"]=>
string(6) "global"
["zendtestns2\ZEND_CONSTANT_A"]=>
string(10) "namespaced"
["zendtestns2\zendsubns\ZEND_CONSTANT_A"]=>
string(10) "namespaced"
}
array(1) {
["ns1\ns2\Const1"]=>
string(6) "value1"
}