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.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
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.33
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:
128.55 ms | 401 KiB | 120 Q