3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = '[ { "surname": "", "name": "Andrea Fiore", "city": "Crocino", "address": "via Emo Mannucci, 2", "telephone": "123456789", "email": "x@gmail.com", "startData": "2019-07-04", "finishData": "2019-07-25", "cardId": "2", "state": "true" } ]'; $data = json_decode($json, true); $filter = array_filter($data, function($row) { return $row['email'] == 'x@gmail.com'; }); if(count(($indexs = array_keys($filter))) == 1) { $data[$indexs[0]] = array( 'foo' => 'bar', ); } var_dump($data);
Output for git.master, git.master_jit, rfc.property-hooks
array(1) { [0]=> array(1) { ["foo"]=> string(3) "bar" } }

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:
92.19 ms | 401 KiB | 8 Q