mirror of
https://github.com/php/php-src.git
synced 2025-08-16 14:08:47 +02:00
Merge branch 'PHP-7.3' into PHP-7.4
This commit is contained in:
commit
071b389bc6
2 changed files with 28 additions and 2 deletions
|
@ -3091,8 +3091,10 @@ static int zend_update_type_info(const zend_op_array *op_array,
|
||||||
tmp = t1;
|
tmp = t1;
|
||||||
if (t1 & MAY_BE_ARRAY) {
|
if (t1 & MAY_BE_ARRAY) {
|
||||||
tmp |= MAY_BE_RC1 | MAY_BE_RCN;
|
tmp |= MAY_BE_RC1 | MAY_BE_RCN;
|
||||||
/* SEND_UNPACK may acquire references into the array */
|
if (t1 & MAY_BE_ARRAY_OF_ANY) {
|
||||||
tmp |= MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF;
|
/* SEND_UNPACK may acquire references into the array */
|
||||||
|
tmp |= MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (t1 & MAY_BE_OBJECT) {
|
if (t1 & MAY_BE_OBJECT) {
|
||||||
tmp |= MAY_BE_RC1 | MAY_BE_RCN;
|
tmp |= MAY_BE_RC1 | MAY_BE_RCN;
|
||||||
|
|
24
ext/opcache/tests/send_unpack_empty_array.phpt
Normal file
24
ext/opcache/tests/send_unpack_empty_array.phpt
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
--TEST--
|
||||||
|
Type inference of SEND_UNPACK with empty array
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
function test() {
|
||||||
|
$array = [1, 2, 3];
|
||||||
|
$values = [];
|
||||||
|
var_dump(array_push($array, 4, ...$values));
|
||||||
|
var_dump($array);
|
||||||
|
}
|
||||||
|
test();
|
||||||
|
?>
|
||||||
|
--EXPECT--
|
||||||
|
int(4)
|
||||||
|
array(4) {
|
||||||
|
[0]=>
|
||||||
|
int(1)
|
||||||
|
[1]=>
|
||||||
|
int(2)
|
||||||
|
[2]=>
|
||||||
|
int(3)
|
||||||
|
[3]=>
|
||||||
|
int(4)
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue