3v4l.org

run code in 500+ PHP versions simultaneously
<?php $customers='[ { "id": 1, "name": "sara", "phone": 1100, "mobile": 1111 }, { "id": 2, "name": "ben", "phone": 2200, "mobile": 2222 } ]'; foreach(json_decode($customers, true) as $a){ if($a['name'] == 'sara'){ $phone = $a['phone']; $mobile = $a['mobile']; echo "sara's phone is $phone"; echo "sara's mobile is $mobile"; } else{ echo "No customer found with this name"; } }
Output for rfc.property-hooks, git.master, git.master_jit
sara's phone is 1100sara's mobile is 1111No customer found with this name

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:
40.38 ms | 1108 KiB | 4 Q