3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* This breaks depending on the version of PHP PHP 5 generates the following Strict Standards: Declaration of Daz::delete() should be compatible with Foo::delete($completely = true) on line 51 Strict Standards: Declaration of Jaz::delete() should be compatible with Foo::delete($completely = true) on line 62 Foo::delete(1) Baz::delete(1, ) Daz::delete(1) Jaz::delete(1) PHP 7 generates the following Warning: Declaration of Daz::delete($newsletterid) should be compatible with Foo::delete($completely = true) on line 51 Warning: Declaration of Jaz::delete() should be compatible with Foo::delete($completely = true) on line 62 Foo::delete(1) Baz::delete(1, ) Daz::delete(1) Jaz::delete(1) */ class Foo { public function delete($completely = true) { echo "Foo::delete($completely)".PHP_EOL; } } class Baz extends Foo { public function delete($completely = true, $lang = false) { echo "Baz::delete($completely, $lang)".PHP_EOL; } } class Daz extends Foo { public function delete($newsletterid) { echo "Daz::delete($newsletterid)".PHP_EOL; } } class Jaz extends Foo { public function delete($newsletterid = '') { echo "Jaz::delete($newsletterid)".PHP_EOL; } } $foo = new Foo(); $baz = new Baz(); $daz = new Daz(); $jaz = new Jaz(); $foo->delete(); echo PHP_EOL; $baz->delete(); echo PHP_EOL; $daz->delete(1); echo PHP_EOL; $jaz->delete(1);
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Declaration of Daz::delete($newsletterid) must be compatible with Foo::delete($completely = true) in /in/hMN5P on line 47
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:
34.26 ms | 405 KiB | 5 Q