3v4l.org

run code in 500+ PHP versions simultaneously
<?php $proposedName = "Illegal Name"; try { eval("class $proposedName {}; new $proposedName();"); } catch (\Throwable $t) { print "Illegal name: ". $t->getMessage(); }
Output for 8.2.0 - 8.2.34, 8.3.0 - 8.3.35, 8.4.1 - 8.4.26, 8.5.0 - 8.5.11
Illegal name: syntax error, unexpected identifier "Name", expecting "{"

preferences:
28.81 ms | 1136 KiB | 7 Q