3v4l.org

run code in 300+ PHP versions simultaneously
<?php class AAA { public function bbb() { var_dump(get_class(null)); } } (new AAA)->bbb();
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.26, 8.4.1 - 8.4.13
Fatal error: Uncaught TypeError: get_class(): Argument #1 ($object) must be of type object, null given in /in/5O4QA:7 Stack trace: #0 /in/5O4QA(11): AAA->bbb() #1 {main} thrown in /in/5O4QA on line 7
Process exited with code 255.
Output for 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
Warning: get_class() expects parameter 1 to be object, null given in /in/5O4QA on line 7 bool(false)
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.25
string(3) "AAA"

preferences:
152.49 ms | 408 KiB | 5 Q