1
0
mirror of https://github.com/php/php-src.git synced 2026-03-26 09:12:14 +01:00
Files
archived-php-src/ext/standard/tests/array/bug31158.phpt
Máté Kocsis 36935e42ea Improve undefined variable error messages
Closes GH-5312
2020-03-31 13:02:32 +02:00

21 lines
442 B
PHP

--TEST--
Bug #31158 (array_splice on $GLOBALS crashes)
--INI--
error_reporting = E_ALL
--FILE--
<?php
function __(){
$GLOBALS['a'] = "bug\n";
array_splice($GLOBALS,0,count($GLOBALS));
/* All global variables including $GLOBALS are removed */
echo $GLOBALS['a'];
}
__();
echo "ok\n";
?>
--EXPECTF--
Warning: Undefined variable $GLOBALS in %s on line %d
Warning: Trying to access array offset on value of type null in %s on line %d
ok