3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface I { } class A implements I { } class B extends A { } $b = new B(); echo "B <-> I:\n"; var_dump($b instanceof I); var_dump(is_a($b, "I")); var_dump(is_subclass_of($b, "I")); $rc = new ReflectionClass("B"); var_dump($rc->getInterfaceNames()); echo "\n\nB <-> A:\n"; var_dump($b instanceof A); var_dump(is_a($b, "A")); var_dump(is_subclass_of($b, "A"));
Output for git.master, git.master_jit, rfc.property-hooks
B <-> I: bool(true) bool(true) bool(true) array(1) { [0]=> string(1) "I" } B <-> A: bool(true) bool(true) bool(true)

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
57.04 ms | 401 KiB | 8 Q