3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = '[ { "CarID": "f11gh126-dee8-46ef-9665-69119c354575", "CarReg": "ABCD" }, { "CarID": "e258f6d4-4503-5d7e-b25c-1fb9767061e2", "CarReg": "DEFG" } ]'; $arr = json_decode($json, true); $carId = array_filter($arr, function($item){ return $item['CarReg'] == 'ABCD'; })[0]['CarID']; echo $carId;
Output for git.master_jit, git.master, rfc.property-hooks
f11gh126-dee8-46ef-9665-69119c354575

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