xref: /PHP-7.0/ext/standard/tests/array/bug31158.phpt (revision cd1b44c4)
1--TEST--
2Bug #31158 (array_splice on $GLOBALS crashes)
3--INI--
4error_reporting = E_ALL
5--FILE--
6<?php
7function __(){
8  $GLOBALS['a'] = "bug\n";
9  array_splice($GLOBALS,0,count($GLOBALS));
10  /* All global variables including $GLOBALS are removed */
11  echo $GLOBALS['a'];
12}
13__();
14echo "ok\n";
15?>
16--EXPECTF--
17Notice: Undefined variable: GLOBALS in %sbug31158.php on line 6
18ok
19
20