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, true); $filteredResults = array_filter($newData['true'], function($item) { return isset($item['registration_id']); }); print_r($filteredResults);
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined array key "true" in /in/rT4df on line 17 Fatal error: Uncaught TypeError: array_filter(): Argument #1 ($array) must be of type array, null given in /in/rT4df:17 Stack trace: #0 /in/rT4df(17): array_filter(NULL, Object(Closure)) #1 {main} thrown in /in/rT4df on line 17
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:
40.46 ms | 401 KiB | 8 Q