3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data='{"multicast_id":7917175795873320166,"success":6,"failure":0,"canonical_ids":4, "results":[ {"registration_id":"3","message_id":"m1"}, {"message_id":"m1"}, {"message_id":"m1"}, {"registration_id":"3","message_id":"m1"}, {"registration_id":"3","message_id":"m1"}, {"registration_id":"3","message_id":"m1"}]}'; $newData=json_decode($data); $filteredResults = array_filter($newData->results, function($item) { return isset($item['registration_id']); }); print_r($filteredResults);
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Cannot use object of type stdClass as array in /in/PMrlk:18 Stack trace: #0 [internal function]: {closure}(Object(stdClass)) #1 /in/PMrlk(17): array_filter(Array, Object(Closure)) #2 {main} thrown in /in/PMrlk on line 18
Process exited with code 255.

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