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.
 
 

26 lines
556 B

--TEST--
prev - ensure warning is received when passing an indirect temporary.
--SKIPIF--
<?php die("skip AOT prev() error handling differs from PHP"); ?>
--FILE--
<?php
/*
* Pass temporary variables to prev() to test behaviour
*/
function f()
{
$array = array(1, 2);
end($array);
return $array;
}
function main()
{
echo "\n-- Passing an indirect temporary variable --\n";
var_dump(prev(f()));
}
?>
--EXPECTF--
-- Passing an indirect temporary variable --
Notice: Only variables should be passed by reference in %s on line %d
int(1)