summaryrefslogtreecommitdiff
path: root/ext/standard/tests/array/bug31158.phpt
blob: e672a10b28d62a0bbd99abf6b8cd6c58f538fa30 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
--TEST--
Bug #31158 (array_splice on $GLOBALS crashes)
--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--
Notice: Undefined variable: GLOBALS in %sbug31158.php on line 6
ok