3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $accessories = json_decode('{"SMALL IS ENCLOSURE":{"src":"\/assets\/media\/images\/groups\/accessories\/EnclosureSmall_thumbnail.jpg","alt":"SMALL IS ENCLOSURE","link":""},"LARGE SPACESAVER IS4, ISW, IS4SST":{"src":"\/assets\/media\/images\/groups\/accessories\/IS4_Space_Saver.jpg","alt":"LARGE SPACESAVER IS4, ISW, IS4SST","link":""},"SMALL SPACESAVER IS2":{"src":"\/assets\/media\/images\/groups\/accessories\/IS2_Space_Saver.jpg","alt":"SMALL SPACESAVER IS2","link":""}}'); foreach( $accessories AS $key => $value ) { $udpateAccessories[] = array($key => $value); } echo(json_encode($udpateAccessories));
Output for 5.2.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
[{"SMALL IS ENCLOSURE":{"src":"\/assets\/media\/images\/groups\/accessories\/EnclosureSmall_thumbnail.jpg","alt":"SMALL IS ENCLOSURE","link":""}},{"LARGE SPACESAVER IS4, ISW, IS4SST":{"src":"\/assets\/media\/images\/groups\/accessories\/IS4_Space_Saver.jpg","alt":"LARGE SPACESAVER IS4, ISW, IS4SST","link":""}},{"SMALL SPACESAVER IS2":{"src":"\/assets\/media\/images\/groups\/accessories\/IS2_Space_Saver.jpg","alt":"SMALL SPACESAVER IS2","link":""}}]
Output for 5.0.0 - 5.1.6
Fatal error: Call to undefined function json_decode() in /in/j0Rot on line 3
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: json_decode() in /in/j0Rot on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: json_decode() in /in/j0Rot on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: json_decode() in /in/j0Rot on line 3