3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php error_reporting(-1 ^ E_STRICT); class A { function B() { var_dump($this); } static function C() { var_dump($this); } } $a = new A(); $a::C();
based on 12blH
Output for 7.1.0 - 7.2.0
Fatal error: Uncaught Error: Using $this when not in object context in /in/C0naV:9 Stack trace: #0 /in/C0naV(14): A::C() #1 {main} thrown in /in/C0naV on line 9
Process exited with code 255.
Output for 5.3.18 - 7.0.20
Notice: Undefined variable: this in /in/C0naV on line 9 NULL