File tree Expand file tree Collapse file tree 4 files changed +24
-16
lines changed Expand file tree Collapse file tree 4 files changed +24
-16
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,10 @@ PHP NEWS
22|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33?? ??? ????, PHP 8.2.7
44
5+ - Core:
6+ . Fixed bug GH-11152 (Unable to alias namespaces containing reserved class
7+ names). (ilutov)
8+
59- Opcache:
610 . Fixed bug GH-11134 (Incorrect match default branch optimization). (ilutov)
711
Original file line number Diff line number Diff line change 1+ --TEST--
2+ GH-11152: Allow aliasing namespaces containing reserved class names
3+ --FILE--
4+ <?php
5+
6+ namespace string ;
7+
8+ use string as StringAlias ;
9+
10+ class C {}
11+
12+ function test (StringAlias \C $ o ) {
13+ var_dump ($ o ::class);
14+ }
15+
16+ test (new C ());
17+
18+ ?>
19+ --EXPECT--
20+ string(8) "string\C"
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -8124,12 +8124,6 @@ static void zend_compile_use(zend_ast *ast) /* {{{ */
81248124 zend_string * old_name = zend_ast_get_str (old_name_ast );
81258125 zend_string * new_name , * lookup_name ;
81268126
8127- /* Check that we are not attempting to alias a built-in type */
8128- if (type == ZEND_SYMBOL_CLASS && zend_is_reserved_class_name (old_name )) {
8129- zend_error_noreturn (E_COMPILE_ERROR ,
8130- "Cannot alias '%s' as it is a built-in type" , ZSTR_VAL (old_name ));
8131- }
8132-
81338127 if (new_name_ast ) {
81348128 new_name = zend_string_copy (zend_ast_get_str (new_name_ast ));
81358129 } else {
You can’t perform that action at this time.
0 commit comments