3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { } class FooCollection implements \Countable, \Iterator { private $fooArray = []; public function addFoo(Foo $foo) { $this->fooArray[] = $foo; } public function addEachFoo(array $fooArray) { foreach ($fooArray as $foo) { $this->addFoo($foo); } } public function count() { ; } public function current() { ; } public function key() { ; } public function next() { ; } public function rewind() { ; } public function valid() { ; } } $fooCollection = new FooCollection(); $fooCollection->addEachFoo([new Foo, new Foo, new Foo]);
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: Return type of FooCollection::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/mnpV4 on line 27 Deprecated: Return type of FooCollection::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/mnpV4 on line 32 Deprecated: Return type of FooCollection::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/mnpV4 on line 42 Deprecated: Return type of FooCollection::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/mnpV4 on line 37 Deprecated: Return type of FooCollection::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/mnpV4 on line 52 Deprecated: Return type of FooCollection::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/mnpV4 on line 47

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:
64.83 ms | 404 KiB | 8 Q