3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 0 => [ "label" => "Radiator", "details" => [[ "label" => "Condition", "value" => "New", ], [ "label" => "Type", "value" => "Wall", ]], ], 1 => [ "label" => "Airco", "details" => [[ "label" => "Condition", "value" => "New", ], [ "label" => "Type", "value" => "", ]], ], 2 => [ "label" => "Refrigerator", "details" => [[ "label" => "Condition", "value" => "Bad", ], [ "label" => "Type", "value" => "Wall", ]], ], ]; foreach($array as &$row){ foreach($row['details'] as $key => $record){ if(strlen($record['value']) == 0){ unset($row['details'][$key]); } } } print_r($array);
Output for git.master_jit, git.master, rfc.property-hooks
Array ( [0] => Array ( [label] => Radiator [details] => Array ( [0] => Array ( [label] => Condition [value] => New ) [1] => Array ( [label] => Type [value] => Wall ) ) ) [1] => Array ( [label] => Airco [details] => Array ( [0] => Array ( [label] => Condition [value] => New ) ) ) [2] => Array ( [label] => Refrigerator [details] => Array ( [0] => Array ( [label] => Condition [value] => Bad ) [1] => Array ( [label] => Type [value] => Wall ) ) ) )

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:
38.25 ms | 409 KiB | 5 Q