3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php /* * Superglobals as local variables?! (or better read-only) */ function test($name, $_COOKIE = NULL) { var_dump($_COOKIE); } print_r($_COOKIE); test('hello'); print_r($_COOKIE); test('hello', array()); print_r($_COOKIE);
Output for hhvm-3.10.0 - 3.12.0
Array ( ) array(0) { } Array ( ) array(0) { } Array ( )
Output for 5.4.0 - 5.4.15
Fatal error: Cannot re-assign auto-global variable _COOKIE in /in/2X7MK on line 6
Process exited with code 255.
Output for 5.3.0 - 5.3.29
Array ( ) NULL array(0) { } Array ( )