mirror of
https://github.com/php/php-src.git
synced 2024-09-22 18:37:25 +00:00
Merge branch 'PHP-8.1'
This commit is contained in:
commit
66af53cab8
11
Zend/tests/bug81684.phpt
Normal file
11
Zend/tests/bug81684.phpt
Normal file
@ -0,0 +1,11 @@
|
||||
--TEST--
|
||||
Bug #81684: ??= on $GLOBALS produces an invalid opcode
|
||||
--FILE--
|
||||
<?php
|
||||
$GLOBALS['x'] ??= 'x'; // Fatal error: Invalid opcode 23/1/0
|
||||
var_dump($GLOBALS['x']);
|
||||
echo "Done.\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
string(1) "x"
|
||||
Done.
|
@ -8925,7 +8925,9 @@ static void zend_compile_assign_coalesce(znode *result, zend_ast *ast) /* {{{ */
|
||||
|
||||
/* Reproduce some of the zend_compile_assign() opcode fixup logic here. */
|
||||
opline = &CG(active_op_array)->opcodes[CG(active_op_array)->last-1];
|
||||
switch (var_ast->kind) {
|
||||
/* Treat $GLOBALS['x'] assignment like assignment to variable. */
|
||||
zend_ast_kind kind = is_global_var_fetch(var_ast) ? ZEND_AST_VAR : var_ast->kind;
|
||||
switch (kind) {
|
||||
case ZEND_AST_VAR:
|
||||
zend_emit_op_tmp(&assign_node, ZEND_ASSIGN, &var_node_w, &default_node);
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user