Actually it throws an E_NOTICE. Something a fair amount of projects require you to turn off. You know what else throws an E_NOTICE?
$a = notice_there_are_no_quotes;
echo $a; // $a gets assigned the string 'notice_there_are_not_quotes'
This is super fun when you attempt to use a constant and misspell it.
$b = MY_CONSTANTT;
echo $b; // $b is now the string 'MY_CONSTANTT' instead of whatever the correct MY_CONSTANT was set to.
Which is why in both PHP and JavaScript if you really cared about what you were doing, both of those would be methods that throw errors if misspelled
let a = new A();
a.setName('John');
doSomething(a.getNmea()); // Error
$a = new A();
$a->setName('John');
doSomething($a->getNmea()); // Also error