3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
imn-[[[[<?php|$accessories = json_decode('{"BPC8S":{"src":"\/assets\/media\/images\/groups\/accessories\/BPC8S.jpg","alt":"BPC8S","link":""}}'); foreach( $accessories AS $key => $value ) { $udpateAccessories[] = array($key => $value); } echo(json_encode($udpateAccessories));
Output for 7.1.0
imn-[[[[ Notice: Use of undefined constant php - assumed 'php' in /in/RQTgR on line 1 Warning: A non-numeric value encountered in /in/RQTgR on line 1 Notice: Object of class stdClass could not be converted to int in /in/RQTgR on line 1 [{"BPC8S":{"src":"\/assets\/media\/images\/groups\/accessories\/BPC8S.jpg","alt":"BPC8S","link":""}}]
Output for 5.4.0 - 7.0.14
imn-[[[[ Notice: Use of undefined constant php - assumed 'php' in /in/RQTgR on line 1 Notice: Object of class stdClass could not be converted to int in /in/RQTgR on line 1 [{"BPC8S":{"src":"\/assets\/media\/images\/groups\/accessories\/BPC8S.jpg","alt":"BPC8S","link":""}}]
Output for 4.3.0 - 5.3.29
imn-[[[[<?php|$accessories = json_decode('{"BPC8S":{"src":"\/assets\/media\/images\/groups\/accessories\/BPC8S.jpg","alt":"BPC8S","link":""}}'); foreach( $accessories AS $key => $value ) { $udpateAccessories[] = array($key => $value); } echo(json_encode($udpateAccessories));