3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Xyz { function doStuff() { var_dump($this); } } class Mno { function doOriginalStuff() { Xyz::doStuff(); } } $mno = new Mno(); $mno->doOriginalStuff();
Output for 8.2.0 - 8.2.29, 8.3.0 - 8.3.25, 8.4.1 - 8.4.12
Fatal error: Uncaught Error: Non-static method Xyz::doStuff() cannot be called statically in /in/YkbMS:11 Stack trace: #0 /in/YkbMS(16): Mno->doOriginalStuff() #1 {main} thrown in /in/YkbMS on line 11
Process exited with code 255.
Output for 5.6.40
Deprecated: Non-static method Xyz::doStuff() should not be called statically, assuming $this from incompatible context in /in/YkbMS on line 11 object(Mno)#1 (0) { }

preferences:
51.83 ms | 407 KiB | 5 Q