3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php // $a heeft de json in zich $a = '{"champions":[{"id":266,"name":"Aatrox","active":true,"attackRank":8,"defenseRank":4,"magicRank":3,"difficultyRank":6,"botEnabled":false,"freeToPlay":false,"botMmEnabled":false,"rankedPlayEnabled":true}, {"id":103,"name":"Ahri","active":true,"attackRank":3,"defenseRank":4,"magicRank":8,"difficultyRank":8,"botEnabled":false,"freeToPlay":false,"botMmEnabled":false,"rankedPlayEnabled":true}, {"id":84,"name":"Akali","active":true,"attackRank":5,"defenseRank":3,"magicRank":8,"difficultyRank":6,"botEnabled":false,"freeToPlay":false,"botMmEnabled":false,"rankedPlayEnabled":true}]}'; // zet de json om naar een PHP object $obj = json_decode($a); // dump het complete object op het scherm om te lezen hoe het is opgebouwd echo '<pre>'; print_r($obj); echo '</pre>';
Output for 5.3.0 - 5.6.28, hhvm-3.10.0 - 3.13.2, 7.0.0 - 7.1.0
<pre>stdClass Object ( [champions] => Array ( [0] => stdClass Object ( [id] => 266 [name] => Aatrox [active] => 1 [attackRank] => 8 [defenseRank] => 4 [magicRank] => 3 [difficultyRank] => 6 [botEnabled] => [freeToPlay] => [botMmEnabled] => [rankedPlayEnabled] => 1 ) [1] => stdClass Object ( [id] => 103 [name] => Ahri [active] => 1 [attackRank] => 3 [defenseRank] => 4 [magicRank] => 8 [difficultyRank] => 8 [botEnabled] => [freeToPlay] => [botMmEnabled] => [rankedPlayEnabled] => 1 ) [2] => stdClass Object ( [id] => 84 [name] => Akali [active] => 1 [attackRank] => 5 [defenseRank] => 3 [magicRank] => 8 [difficultyRank] => 6 [botEnabled] => [freeToPlay] => [botMmEnabled] => [rankedPlayEnabled] => 1 ) ) ) </pre>