3v4l.org

run code in 300+ PHP versions simultaneously
<?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 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Fatal error: Uncaught Error: Undefined constant "JSON" in /in/KTPpk:13 Stack trace: #0 {main} thrown in /in/KTPpk on line 13
Process exited with code 255.
Output for 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
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.0.33, 7.1.0 - 7.1.33
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.5.0 - 5.5.38, 5.6.0 - 5.6.40
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.

preferences:
266.33 ms | 402 KiB | 329 Q