3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php // inspired by discussion at: http://stackoverflow.com/questions/11158772/assigning-null-to-a-variable-in-php-what-does-that-do $a = 1; $a = null; echo isset($a) ? 'true' : 'false', "\n"; var_dump($a); // 'NULL' -- no error notice - bug ? type changed to NULL unset($a); // now variable undefined var_dump($a); // error notice and value NULL
Output for 5.0.4 - 5.0.5, 5.1.1 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
false NULL Notice: Undefined variable: a in /in/ijKt6 on line 8 NULL
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/ijKt6 on line 8
Process exited with code 255.
Output for 4.3.0 - 5.0.3
false NULL Notice: Undefined variable: a in /in/ijKt6 on line 8 NULL