mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Merge branch 'PHP-8.1'
* PHP-8.1: Fix FETCH_OBJ_IS type inference
This commit is contained in:
commit
a6615b3419
2 changed files with 28 additions and 0 deletions
|
@ -3530,6 +3530,10 @@ static zend_always_inline int _zend_update_type_info(
|
|||
tmp &= ~MAY_BE_RC1;
|
||||
}
|
||||
}
|
||||
if (opline->opcode == ZEND_FETCH_OBJ_IS) {
|
||||
/* IS check may return null for uninitialized typed property. */
|
||||
tmp |= MAY_BE_NULL;
|
||||
}
|
||||
}
|
||||
UPDATE_SSA_TYPE(tmp, ssa_op->result_def);
|
||||
if (ce) {
|
||||
|
|
24
ext/opcache/tests/jit/fetch_obj_is_typed_prop.phpt
Normal file
24
ext/opcache/tests/jit/fetch_obj_is_typed_prop.phpt
Normal file
|
@ -0,0 +1,24 @@
|
|||
--TEST--
|
||||
FETCH_OBJ_IS on typed object property
|
||||
--INI--
|
||||
opcache.enable=1
|
||||
opcache.enable_cli=1
|
||||
opcache.file_update_protection=0
|
||||
opcache.jit_buffer_size=1M
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Test {
|
||||
public stdClass $data;
|
||||
}
|
||||
|
||||
function test() {
|
||||
$test = new Test;
|
||||
var_dump(isset($test->data[0]));
|
||||
}
|
||||
|
||||
test();
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
Loading…
Add table
Add a link
Reference in a new issue