<?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);
Fatal error: Uncaught Error: Undefined constant "hello" in /in/39e5T:2
Stack trace:
#0 {main}
thrown in /in/39e5T on line 2
Process exited with code 255.
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"