3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo { protected $baz = 'foobar'; public function bar() { self::functionName(); $this->functionName(); } public function functionName() { echo "foobar\n"; } } $f = new Foo(); $f->bar(); $f::functionName();
based on 8srKc
Output for 7.0.0 - 7.2.0
foobar foobar Deprecated: Non-static method Foo::functionName() should not be called statically in /in/QlTVr on line 21 foobar
Output for 5.3.19 - 5.6.28
foobar foobar Strict Standards: Non-static method Foo::functionName() should not be called statically in /in/QlTVr on line 21 foobar