3v4l.org

run code in 300+ PHP versions simultaneously
<?php $photoList = array( array( 'id' => 1, 'name' => 'chelsea.jpg' ), array( 'id' => 2, 'name' => 'mu.jpg' ), array( 'id' => 3, 'name' => 'city.jpg' ) ); if(count($photoList) > 1) { $id = 1; $delete = false; foreach($photoList as $key => &$value) { if($value['id'] == $id && $delete == false){ $delete = true; unset($photoList[$key]); }Else if($delete == true){ $value["id"] = $id; $id++; } } } $photoList= array_values($photoList); Var_dump($photoList);
Output for git.master, git.master_jit, rfc.property-hooks
array(2) { [0]=> array(2) { ["id"]=> int(1) ["name"]=> string(6) "mu.jpg" } [1]=> &array(2) { ["id"]=> int(2) ["name"]=> string(8) "city.jpg" } }

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:
29.83 ms | 405 KiB | 5 Q