3v4l.org

run code in 300+ PHP versions simultaneously
<?php set_error_handler( function ($code, $string) { throw new Exception($string, $code); } ); try { interface I1 {} interface I2 {} class A implements I1 { public function fn() { echo 'foo'; } } class B extends A implements I2 { public function fn($arg) { echo $arg; } } } catch (Exception $e) { // ignore } $b = new B(); var_dump($b instanceof I1); // outputs "bool(false)" var_dump($b instanceof I2); // outputs "bool(false)" var_dump(class_implements('B')); // outputs "array(1) { 'I1' => string(2) "I1" }" $b->fn('bar'); // outputs "bar"
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Declaration of B::fn($arg) must be compatible with A::fn() in /in/fkbOC on line 13
Process exited with code 255.

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:
116.85 ms | 405 KiB | 5 Q