3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait A { function test(ArrayObject $a){ echo "hello A"; } function testA(){ $this->test(new ArrayObject); } } trait B { function test(SplFixedArray $b){ echo "hello B"; } function testB(){ $this->test(new SplFixedArray); } } class C { use A, B{ A::test insteadof B; } } (new C)->testA(); (new C)->testB();
Output for git.master, git.master_jit, rfc.property-hooks
hello A Fatal error: Uncaught TypeError: C::test(): Argument #1 ($a) must be of type ArrayObject, SplFixedArray given, called in /in/RJenh on line 12 and defined in /in/RJenh:5 Stack trace: #0 /in/RJenh(12): C->test(Object(SplFixedArray)) #1 /in/RJenh(23): C->testB() #2 {main} thrown in /in/RJenh on line 5
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:
98.71 ms | 2118 KiB | 4 Q