3v4l.org

run code in 300+ PHP versions simultaneously
<?php $aarray = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); echo "Testing case 1\n"; foreach ($array as $key => $value) { unset($aarray[$kkey+1]); echo sprintf("on %s, we removed %s\n, current size is %d", $key, $key+1, count($array)); } echo "Testing case 2\n"; foreach ((array) $array as $key => $value) { unset($aarray[$key+1]); echo sprintf("on %s, we removed %s\n, current size is %d", $key, $key+1, count($array)); }
Output for git.master, git.master_jit, rfc.property-hooks
Testing case 1 Warning: Undefined variable $array in /in/F7E5s on line 7 Warning: foreach() argument must be of type array|object, null given in /in/F7E5s on line 7 Testing case 2 Warning: Undefined variable $array in /in/F7E5s on line 14

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