TypePHP 编译器
https://swoole.com/aot/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
593 B
31 lines
593 B
--TEST--
|
|
Crash when function parameter modified via reference
|
|
--SKIPIF--
|
|
<?php die("skip AOT does not fully support references"); ?>
|
|
--FILE--
|
|
<?php
|
|
function usercompare($a, $b)
|
|
{
|
|
unset($GLOBALS['my_var'][2]);
|
|
return $a <=> $b;
|
|
}
|
|
function main()
|
|
{
|
|
$my_var = array(1 => "entry_1", 2 => "entry_2", 3 => "entry_3", 4 => "entry_4", 5 => "entry_5");
|
|
usort($my_var, "usercompare");
|
|
var_dump($my_var);
|
|
}
|
|
?>
|
|
--EXPECT--
|
|
array(5) {
|
|
[0]=>
|
|
string(7) "entry_1"
|
|
[1]=>
|
|
string(7) "entry_2"
|
|
[2]=>
|
|
string(7) "entry_3"
|
|
[3]=>
|
|
string(7) "entry_4"
|
|
[4]=>
|
|
string(7) "entry_5"
|
|
}
|
|
|