3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Test { function a() { $this->b = 'c'; echo $this->b; } static function r() { self::a(); } } Test::r();
Output for 7.0.0 - 7.2.0
Deprecated: Non-static method Test::a() should not be called statically in /in/63cuD on line 9 Fatal error: Uncaught Error: Using $this when not in object context in /in/63cuD:4 Stack trace: #0 /in/63cuD(9): Test::a() #1 /in/63cuD(13): Test::r() #2 {main} thrown in /in/63cuD on line 4
Process exited with code 255.
Output for 5.3.22 - 5.6.28
Strict Standards: Non-static method Test::a() should not be called statically in /in/63cuD on line 9 Fatal error: Using $this when not in object context in /in/63cuD on line 4
Process exited with code 255.