3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ [ "id" => 54, "type" => 5, "content" => [ ["id" => 99, "type" => 516], ["id" => 88, "type" => 464], ["id" => 41, "type" => 845] ] ], [ "id" => 54, "type" => 55, "content" => [ ["id" => 54, "type" => 578], ["id" => 54, "type" => 354], ["id" => 75, "type" => 458] ] ], [ "id" => 65, "type" => 59, "content" => [ ["id" => 87, "type" => 5454], ["id" => 65, "type" => 245], ["id" => 65, "type" => 24525] ] ] ]; $id = 54; $type = 55; foreach ($array as &$row) { if ($row["id"] == $id && $row["type"] == $type) { $ref = &$row["content"]; } } $ref = 'this has been changed'; var_export($array);
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => array ( 'id' => 54, 'type' => 5, 'content' => array ( 0 => array ( 'id' => 99, 'type' => 516, ), 1 => array ( 'id' => 88, 'type' => 464, ), 2 => array ( 'id' => 41, 'type' => 845, ), ), ), 1 => array ( 'id' => 54, 'type' => 55, 'content' => 'this has been changed', ), 2 => array ( 'id' => 65, 'type' => 59, 'content' => array ( 0 => array ( 'id' => 87, 'type' => 5454, ), 1 => array ( 'id' => 65, 'type' => 245, ), 2 => array ( 'id' => 65, 'type' => 24525, ), ), ), )

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:
47.76 ms | 1501 KiB | 4 Q