File tree 4 files changed +24
-16
lines changed
4 files changed +24
-16
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,10 @@ PHP NEWS
2
2
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3
3
?? ??? ????, PHP 8.2.7
4
4
5
+ - Core:
6
+ . Fixed bug GH-11152 (Unable to alias namespaces containing reserved class
7
+ names). (ilutov)
8
+
5
9
- Opcache:
6
10
. Fixed bug GH-11134 (Incorrect match default branch optimization). (ilutov)
7
11
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) /* {{{ */
8124
8124
zend_string * old_name = zend_ast_get_str (old_name_ast );
8125
8125
zend_string * new_name , * lookup_name ;
8126
8126
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
-
8133
8127
if (new_name_ast ) {
8134
8128
new_name = zend_string_copy (zend_ast_get_str (new_name_ast ));
8135
8129
} else {
You can’t perform that action at this time.
0 commit comments