3v4l.org

run code in 300+ PHP versions simultaneously
<?php class test implements IteratorAggregate { public function getIterator() { return new ArrayIterator(false); } } foreach(new test() as $t) { echo $t, PHP_EOL; }
Output for git.master, git.master_jit
Deprecated: Return type of test::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/tQjfu on line 4 Fatal error: Uncaught TypeError: ArrayIterator::__construct(): Argument #1 ($array) must be of type array, bool given in /in/tQjfu:5 Stack trace: #0 /in/tQjfu(5): ArrayIterator->__construct(false) #1 /in/tQjfu(9): test->getIterator() #2 {main} thrown in /in/tQjfu on line 5
Process exited with code 255.
Output for rfc.property-hooks
Deprecated: Return type of test::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/tQjfu on line 4 Fatal error: Uncaught TypeError: ArrayIterator::__construct(): Argument #1 ($array) must be of type array, false given in /in/tQjfu:5 Stack trace: #0 /in/tQjfu(5): ArrayIterator->__construct(false) #1 /in/tQjfu(9): test->getIterator() #2 {main} thrown in /in/tQjfu 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:
61.46 ms | 401 KiB | 8 Q