3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { function a() {} } class B extends A {} class C extends B { function a() { var_dump( is_callable( 'parent::a' ) ); var_dump( is_callable( 'A::a' ) ); var_dump( is_callable( array( 'A', 'a' ) ) ); var_dump( method_exists( 'parent', 'a' ) ); var_dump( method_exists( 'A', 'a' ) ); } } $c = new C; $c->a();
Output for 7.0.0 - 7.3.1
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/it5tc on line 3 bool(true) bool(true) bool(true) bool(false) bool(true)
Output for 5.3.0 - 5.6.30, hhvm-3.10.1 - 3.17.3
bool(true) bool(true) bool(true) bool(false) bool(true)
Output for 5.1.2 - 5.2.17
bool(false) bool(false) Strict Standards: Non-static method A::a() cannot be called statically, assuming $this from compatible context C in /in/it5tc on line 13 bool(true) bool(false) bool(true)
Output for 5.1.0 - 5.1.1
bool(false) bool(false) bool(true) bool(false) bool(true)
Output for 4.3.0 - 5.0.5
bool(false) bool(false) bool(true) bool(false) bool(false)