3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = ['one', 'two', 'three', 'four', 'five']; echo 'Current value: ' . current($arr) . "\n"; foreach ($arr as $a) { if ($a === 'three') break; } echo 'Did it change? ' . current($arr) . "\n"; function withRef(array &$arr): void { foreach ($arr as $a) { if ($a === 'three') break; } } withRef($arr); echo 'What about now? ' . current($arr) . "\n";
Output for git.master, git.master_jit
Current value: one Did it change? one What about now? one

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:
37.03 ms | 401 KiB | 7 Q