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.
27 lines
601 B
27 lines
601 B
--TEST--
|
|
Bug #31158 (array_splice on $GLOBALS crashes)
|
|
--INI--
|
|
error_reporting = E_ALL
|
|
--SKIPIF--
|
|
<?php die("skip AOT array_splice on superglobals differs from PHP"); ?>
|
|
--FILE--
|
|
<?php
|
|
function __()
|
|
{
|
|
$GLOBALS['a'] = "bug\n";
|
|
array_splice($GLOBALS, 0, count($GLOBALS));
|
|
/* All global variables including $GLOBALS are removed */
|
|
echo $GLOBALS['a'];
|
|
}
|
|
function main()
|
|
{
|
|
__();
|
|
echo "ok\n";
|
|
}
|
|
?>
|
|
--EXPECTF--
|
|
Fatal error: Uncaught Error: array_splice(): Argument #1 ($array) could not be passed by reference in %s:%d
|
|
Stack trace:
|
|
#0 %s(%d): __()
|
|
#1 {main}
|
|
thrown in %s on line %d
|
|
|