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:
29
ext/zend_test/tests/gh11423.phpt
Normal file
29
ext/zend_test/tests/gh11423.phpt
Normal 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"
|
||||
}
|
||||
Reference in New Issue
Block a user