mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
Merge branch 'PHP-8.3'
* PHP-8.3: Fix invalid returned opcode for memoized expressions
This commit is contained in:
commit
24d6dce668
8
Zend/tests/assign_coalesce_009.phpt
Normal file
8
Zend/tests/assign_coalesce_009.phpt
Normal file
@ -0,0 +1,8 @@
|
||||
--TEST--
|
||||
Invalid opcode returned from zend_compile_var_inner() for memoized expression
|
||||
--FILE--
|
||||
<?php
|
||||
strlen("foo")[0] ??= 123;
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot use result of built-in function in write context in %s on line %d
|
@ -10616,7 +10616,8 @@ static zend_op *zend_compile_var_inner(znode *result, zend_ast *ast, uint32_t ty
|
||||
case ZEND_AST_NULLSAFE_METHOD_CALL:
|
||||
case ZEND_AST_STATIC_CALL:
|
||||
zend_compile_memoized_expr(result, ast);
|
||||
return &CG(active_op_array)->opcodes[CG(active_op_array)->last - 1];
|
||||
/* This might not actually produce an opcode, e.g. for expressions evaluated at comptime. */
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user