3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $json=<<<JSON { "players": [ { "name": "Moldova", "image": "/Images/Moldova.jpg", "roll_over_image": "tank.jpg" }, { "name": "Georgia", "image": "/Images/georgia.gif", "roll_over_image": "tank.jpg" }, { "name": "Belarus", "image": "/Images/Belarus.gif", "roll_over_image": "tank.jpg" }, { "name": "Armenia", "image": "/Images/armenia.png", "roll_over_image": "tank.jpg" }, { "name": "Kazahstan", "image": "/Images/kazahstan.gif", "roll_over_image": "tank.jpg" }, { "name": "Russia", "image": "/Images/russia.gif", "roll_over_image": "tank.jpg" }, { "name": "Ukraine", "image": "/Images/ukraine.png", "roll_over_image": "tank.jpg" }, { "name": "Uzbekistan", "image": "/Images/uzbekistan.gif", "roll_over_image": "tank.jpg" } ], "games": [ { "matches": [ { "player1id": 0, "player2id": 1, "winner": "*" }, { "player1id": 2, "player2id": 3, "winner": "*" }, { "player1id": 4, "player2id": 5, "winner": "*" }, { "player1id": 6, "player2id": 7, "winner": "*" }, { "player1id": 0, "player2id": 2, "winner": "*" }, { "player1id": 4, "player2id": 6, "winner": "*" }, { "player1id": 0, "player2id": 4, "winner": 4 } ] }, { "matches": [ { "player1id": 0, "player2id": 1, "winner": "*" }, { "player1id": 2, "player2id": 3, "winner": "*" }, { "player1id": 4, "player2id": 5, "winner": "*" }, { "player1id": 6, "player2id": 7, "winner": "*" }, { "player1id": 0, "player2id": 2, "winner": "*" }, { "player1id": 4, "player2id": 6, "winner": "*" }, { "player1id": 0, "player2id": 4, "winner": 0 } ] } ] } JSON; $tempArray=json_decode($json,true); echo "Original:\n"; print_r($tempArray); $matches=array("games"=>array(array("matches"=>4=>array(array("winner"=>"winner","player1id"=>"player1id","player2id"=>"player2id"))))); echo "\nTempered:\n"; print_r(array_merge_recursive($tempArray,$matches));
Output for 5.4.0 - 5.4.14
Parse error: syntax error, unexpected '=>' (T_DOUBLE_ARROW), expecting ')' in /in/XrDbU on line 131
Process exited with code 255.
Output for 5.3.0 - 5.3.24
Parse error: syntax error, unexpected T_DOUBLE_ARROW, expecting ')' in /in/XrDbU on line 131
Process exited with code 255.