3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { public function a() { echo __METHOD__ . "\n"; } public static function b() { echo __METHOD__ . "\n"; } } A::a(); $a = new A(); $a->b();
based on nqK47
Output for 7.0.0 - 7.2.0
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; A has a deprecated constructor in /in/S5dPV on line 3 Fatal error: Uncaught Error: Non-static method A::a() cannot be called statically in /in/S5dPV:16 Stack trace: #0 {main} thrown in /in/S5dPV on line 16
Process exited with code 255.
Output for 5.3.19 - 5.6.21
Fatal error: Non-static method A::a() cannot be called statically in /in/S5dPV on line 16
Process exited with code 255.