3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php var_dump(hello); function atom(...$atoms) { array_walk( $atoms, function ($atom) { if (defined($atom)) { if ($atom !== constant($atom)) raise("The atom is already defined with a different value: ".$atom); } else { define($atom, $atom); } } ); } atom(@atom); atom(@raise); atom(@dispatch); atom(@acceptsmessage); atom(@isatom); var_dump(@atom);
based on sMAiv
Output for 7.2.0
Warning: Use of undefined constant hello - assumed 'hello' (this will throw an Error in a future version of PHP) in /in/39e5T on line 2 string(5) "hello" string(4) "atom"
Output for 5.6.8 - 7.1.10
Notice: Use of undefined constant hello - assumed 'hello' in /in/39e5T on line 2 string(5) "hello" string(4) "atom"
Output for 5.4.9 - 5.5.35
Parse error: syntax error, unexpected '.', expecting '&' or variable (T_VARIABLE) in /in/39e5T on line 3
Process exited with code 255.
Output for 5.3.19 - 5.3.29
Parse error: syntax error, unexpected '.', expecting '&' or T_VARIABLE in /in/39e5T on line 3
Process exited with code 255.