3v4l.org

run code in 300+ PHP versions simultaneously
<?php $gender = array ('boy', 'girl', 'trangender'); $shopping_data = array( 'boy' => array( 'accessory' => array('belt','wallet','watch'), 'age' => array(20,45,50) ), 'girl'=> array( 'accessory' => array('hair-clip','wallet','watch'), 'age' => array(30,40) ) ); foreach($gender as $gen){ if(isset($shopping_data[$gen])){ echo $gen .":\n"; foreach($shopping_data[$gen]["accessory"] as $acc){ echo $acc . "\n"; } echo "\n\n"; } }
Output for git.master, git.master_jit, rfc.property-hooks
boy: belt wallet watch girl: hair-clip wallet watch

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