3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $information = array("login" => "someUsername", "password" => "somePassword", "card_pin"=>"card_1234", "pin"=>"pin_356", "iin" => "iin_123", "shipping" => array("telephone" => "telephone_998"), "cardnumber" => "card_number_876", "customer_id" => "customer_654", "telephone" => "someOtherTelephoneNumber555"); $json = JSON.stringify($information); $jsonIterator = new RecursiveIteratorIterator( new RecursiveArrayIterator(json_decode($json, TRUE)), RecursiveIteratorIterator::SELF_FIRST); foreach ($jsonIterator as $key => $val) { if(is_array($val)) { echo "$key:\n"; } else { echo "$key => $val\n"; } }
Output for 7.2.0
Warning: Use of undefined constant JSON - assumed 'JSON' (this will throw an Error in a future version of PHP) in /in/KTPpk on line 13 Fatal error: Uncaught Error: Call to undefined function stringify() in /in/KTPpk:13 Stack trace: #0 {main} thrown in /in/KTPpk on line 13
Process exited with code 255.
Output for 7.0.0 - 7.1.10
Notice: Use of undefined constant JSON - assumed 'JSON' in /in/KTPpk on line 13 Fatal error: Uncaught Error: Call to undefined function stringify() in /in/KTPpk:13 Stack trace: #0 {main} thrown in /in/KTPpk on line 13
Process exited with code 255.
Output for 5.3.19 - 5.6.28
Notice: Use of undefined constant JSON - assumed 'JSON' in /in/KTPpk on line 13 Fatal error: Call to undefined function stringify() in /in/KTPpk on line 13
Process exited with code 255.