3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $accessories = json_decode('{"SMALL RECTANGLE RETROFIT ENCLOSURE":{"src":"\/assets\/media\/images\/groups\/accessories\/Medium_Rectangle_Retrofit_Enclosure_92342.jpg","alt":"SMALL RECTANGLE RETROFIT ENCLOSURE","link":""},"SMALL RECTANGLE FLEX BRACKET (5 PAIR PER BOX)":{"src":"\/assets\/media\/images\/groups\/accessories\/Medium_Rectangle_FlexBracket_92336.jpg","alt":"SMALL RECTANGLE FLEX BRACKET (5 PAIR PER BOX)","link":""},"FIRE-RATED LISTED SHALLOW BACKCAN (RECTANGLE)":{"src":"\/assets\/media\/images\/groups\/accessories\/Fire-Rated_Listed_Shallow_Backcan_92807_frt.jpg","alt":"FIRE-RATED LISTED SHALLOW BACKCAN (RECTANGLE)","link":""}}'); foreach( $accessories AS $key => $value ) { $udpateAccessories[] = array($key => $value); } echo(json_encode($udpateAccessories));
Output for 5.2.0 - 7.1.0
[{"SMALL RECTANGLE RETROFIT ENCLOSURE":{"src":"\/assets\/media\/images\/groups\/accessories\/Medium_Rectangle_Retrofit_Enclosure_92342.jpg","alt":"SMALL RECTANGLE RETROFIT ENCLOSURE","link":""}},{"SMALL RECTANGLE FLEX BRACKET (5 PAIR PER BOX)":{"src":"\/assets\/media\/images\/groups\/accessories\/Medium_Rectangle_FlexBracket_92336.jpg","alt":"SMALL RECTANGLE FLEX BRACKET (5 PAIR PER BOX)","link":""}},{"FIRE-RATED LISTED SHALLOW BACKCAN (RECTANGLE)":{"src":"\/assets\/media\/images\/groups\/accessories\/Fire-Rated_Listed_Shallow_Backcan_92807_frt.jpg","alt":"FIRE-RATED LISTED SHALLOW BACKCAN (RECTANGLE)","link":""}}]
Output for 5.0.0 - 5.1.6
Fatal error: Call to undefined function json_decode() in /in/1sbo0 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/1sbo0 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/1sbo0 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/1sbo0 on line 3