3v4l.org

run code in 300+ PHP versions simultaneously
<?php class I extends ArrayIterator { public function current() { return parent::current(); } } $a = new ArrayObject([1, 2, 3], 0, I::class); foreach ($a as $key => &$value) { $value += 10; } unset($value); var_dump($a);
Output for git.master, git.master_jit
Deprecated: Return type of I::current() should either be compatible with ArrayIterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/00Z3F on line 5 Fatal error: Uncaught Error: An iterator cannot be used with foreach by reference in /in/00Z3F:12 Stack trace: #0 {main} thrown in /in/00Z3F on line 12
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.63 ms | 409 KiB | 5 Q