3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = '[ { "seasonNumber":1, "numWins":1, "numHighBracket":2, "numLowBracket":2, "seasonXp":111, "seasonLevel":5, "bookXp":0, "bookLevel":1, "purchasedVIP":false }, { "seasonNumber":2, "numWins":1, "numHighBracket":21, "numLowBracket":31, "seasonXp":1651, "seasonLevel":25, "bookXp":9, "bookLevel":11, "purchasedVIP":false }, { "seasonNumber":3, "numWins":9, "numHighBracket":57, "numLowBracket":127, "seasonXp":4659, "seasonLevel":68, "bookXp":0, "bookLevel":100, "purchasedVIP":true }, { "seasonNumber":4, "numWins":8, "numHighBracket":19, "numLowBracket":36, "seasonXp":274, "seasonLevel":33, "bookXp":7, "bookLevel":35, "purchasedVIP":true } ]'; foreach (json_decode($json) as $set) { $array[] = ["season" => $set->seasonNumber, "battle_pass" => $set->purchasedVIP]; } echo json_encode(["seasons" => $array], JSON_FORCE_OBJECT | JSON_PRETTY_PRINT);
Output for git.master, git.master_jit, rfc.property-hooks
{ "seasons": { "0": { "season": 1, "battle_pass": false }, "1": { "season": 2, "battle_pass": false }, "2": { "season": 3, "battle_pass": true }, "3": { "season": 4, "battle_pass": true } } }

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:
22.17 ms | 406 KiB | 5 Q