3v4l.org

run code in 300+ PHP versions simultaneously
<?php $ar = []; $ar['ar0']['y'] = 'Yes'; $ar['ar0']['n'] = 'No'; $ar['ar1']['g'] = 'good'; $ar['ar1']['b'] = 'bad'; $ar['ar2']['m'] = 'mom'; $ar['ar2']['d'] = 'dad'; print_r($ar); $res_ar = []; // resultant array $ar_names = []; // array of unique names foreach($ar as $ind => $row){ if (!empty($row['y']) && $row['y'] == 'Yes') $res_ar[$ind] = $row; } print_r($res_ar);
Output for git.master, rfc.partials
Array ( [ar0] => Array ( [y] => Yes [n] => No ) [ar1] => Array ( [g] => good [b] => bad ) [ar2] => Array ( [m] => mom [d] => dad ) ) Array ( [ar0] => Array ( [y] => Yes [n] => No ) )

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:
76.68 ms | 459 KiB | 5 Q