Skip to content

Commit b33697d

Browse files
committed
Merge branch 'PHP-7.4'
* PHP-7.4: Fixed bug #79193
2 parents 38e2762 + f70b552 commit b33697d

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

ext/opcache/Optimizer/zend_inference.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2957,6 +2957,13 @@ static int zend_update_type_info(const zend_op_array *op_array,
29572957
UPDATE_SSA_TYPE(tmp, ssa_ops[i].op1_def);
29582958
}
29592959
break;
2960+
case ZEND_ASSIGN_STATIC_PROP_REF:
2961+
if ((opline+1)->op1_type == IS_CV) {
2962+
opline++;
2963+
i++;
2964+
UPDATE_SSA_TYPE(MAY_BE_REF, ssa_ops[i].op1_def);
2965+
}
2966+
break;
29602967
case ZEND_BIND_GLOBAL:
29612968
tmp = MAY_BE_REF | MAY_BE_ANY
29622969
| MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF;

ext/opcache/tests/bug79193.phpt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
--TEST--
2+
Bug #79193: Incorrect type inference for self::$field =& $field
3+
--FILE--
4+
<?php
5+
6+
class Test {
7+
public static $foo;
8+
public static function method($bar) {
9+
Test::$foo =& $bar;
10+
var_dump(is_int($bar));
11+
}
12+
}
13+
14+
Test::method(1);
15+
16+
?>
17+
--EXPECT--
18+
bool(true)

0 commit comments

Comments
 (0)