3v4l.org

run code in 200+ 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.3.0alpha1 - 7.3.0rc4
imn-[[[[ Warning: Use of undefined constant php - assumed 'php' (this will throw an Error in a future version of PHP) in /in/RQTgR on line 1 Notice: Object of class stdClass could not be converted to int in /in/RQTgR on line 1 Warning: A non-numeric value encountered in /in/RQTgR on line 1 [{"BPC8S":{"src":"\/assets\/media\/images\/groups\/accessories\/BPC8S.jpg","alt":"BPC8S","link":""}}]
Output for 7.2.0 - 7.2.6
imn-[[[[ Warning: Use of undefined constant php - assumed 'php' (this will throw an Error in a future version of 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 7.1.0 - 7.1.20
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.20
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));