3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace foo; #[Blah] function doit() { echo __FUNCTION__, "\n"; } echo doit::MY_CONSTANT, "\n";
Output for 8.0.1 - 8.0.22, 8.1.0 - 8.1.9
Fatal error: Uncaught Error: Class "foo\doit" not found in /in/PMf7H:9 Stack trace: #0 {main} thrown in /in/PMf7H on line 9
Process exited with code 255.
Output for 7.4.0 - 7.4.30
Fatal error: Uncaught Error: Class 'foo\doit' not found in /in/PMf7H:9 Stack trace: #0 {main} thrown in /in/PMf7H on line 9
Process exited with code 255.

preferences:
29.46 ms | 413 KiB | 12 Q