3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array( "item1" => array( "conditions" => array( "foo" => true, ), ), "item2" => array( "conditions" => array( "foo" => true, ), ), "item3" => array( "conditions" => array( "foo" => true, ), ), "item4" => array( "conditions" => array( "foo" => false, ), ), "item5" => array( "conditions" => array( "foo" => false, ), ), "item6" => array( "conditions" => array( "foo" => false, ), ), "item7" => array(), "item8" => array(), "item9" => array(), ); $settings = array( "foo" => true, ); foreach($arr as $item_name => $item){ foreach($item["conditions"] as $key => $value){ if($settings[$key] == $value){ echo $item_name, "\n"; } else { break; } } }
Output for git.master, git.master_jit, rfc.property-hooks
item1 item2 item3 Warning: Undefined array key "conditions" in /in/B0Yjg on line 45 Warning: foreach() argument must be of type array|object, null given in /in/B0Yjg on line 45 Warning: Undefined array key "conditions" in /in/B0Yjg on line 45 Warning: foreach() argument must be of type array|object, null given in /in/B0Yjg on line 45 Warning: Undefined array key "conditions" in /in/B0Yjg on line 45 Warning: foreach() argument must be of type array|object, null given in /in/B0Yjg on line 45

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:
46.51 ms | 402 KiB | 8 Q