3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Ancestor { public $publicVar = 'ancestor\'s public var'; static $statisVar = 'ancestor\'s static var'; function publicMethod(){ // is $this is set up if(isset($this)){ echo "publicMethod is in object context"; }else{ echo "publicMethod is in static context"; } } } Ancestor::publicMethod();
based on sNqtO
Output for 7.0.0 - 7.2.0
Deprecated: Non-static method Ancestor::publicMethod() should not be called statically in /in/3HChZ on line 15 publicMethod is in static context
Output for 5.3.18 - 5.6.28
Strict Standards: Non-static method Ancestor::publicMethod() should not be called statically in /in/3HChZ on line 15 publicMethod is in static context