3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo{} class bar extends foo{} class foobar { function startTest() { $bar = new bar(); $this->test($bar); } function test(foobar $testObject) { print_r(get_class($testObject)); } } $foobar = new foobar(); $foobar->startTest();
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught TypeError: foobar::test(): Argument #1 ($testObject) must be of type foobar, bar given, called in /in/PTQrk on line 11 and defined in /in/PTQrk:14 Stack trace: #0 /in/PTQrk(11): foobar->test(Object(bar)) #1 /in/PTQrk(20): foobar->startTest() #2 {main} thrown in /in/PTQrk on line 14
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:
36.11 ms | 401 KiB | 8 Q