3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php // TEST $arr = json_decode(' [ { "Settings":[], "Fields":[ {"txt":"Name of the product","comment":"","cb":true,"na":false}, {"txt":"Regular price","comment":"","cb":false,"na":false}, {"txt":"1-Day Deal price","comment":"","cb":false,"na":false}, {"txt":"Clearance price","comment":"","cb":false,"na":false}, {"txt":"Copy","comment":"","cb":true,"na":false}, {"txt":"SKU is created and live","comment":"","cb":true,"na":false}, {"txt":"Colors available","comment":"","cb":true,"na":false}, {"txt":"Subject line","comment":"","cb":true,"na":false}, {"txt":"Coupon code","comment":"","cb":false,"na":false}, {"txt":"Coupon code - start date","comment":"","cb":false,"na":false}, {"txt":"Disclaimer verbiage within email","comment":"","cb":true,"na":false}, {"txt":"Disclaimer verbiage within MailChimp","comment":"","cb":true,"na":false}, {"txt":"Distributing to the correct email lists","comment":"","cb":true,"na":false}, {"txt":"Masthead Creative and Copy","comment":"","cb":true,"na":false}, {"txt":"Promo Graphic Creative and Copy","comment":"","cb":false,"na":false} ], "Others":[ {"txt":"Additional Comments","val":"gfdgfd"} ] } ] ', true); //print $arr[0][Fields][0][txt]; foreach($arr[0][Fields] as $key) { echo $key[txt]; }
Output for 5.2.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Notice: Use of undefined constant Fields - assumed 'Fields' in /in/rTdgM on line 32 Notice: Use of undefined constant txt - assumed 'txt' in /in/rTdgM on line 34 Name of the product Notice: Use of undefined constant txt - assumed 'txt' in /in/rTdgM on line 34 Regular price Notice: Use of undefined constant txt - assumed 'txt' in /in/rTdgM on line 34 1-Day Deal price Notice: Use of undefined constant txt - assumed 'txt' in /in/rTdgM on line 34 Clearance price Notice: Use of undefined constant txt - assumed 'txt' in /in/rTdgM on line 34 Copy Notice: Use of undefined constant txt - assumed 'txt' in /in/rTdgM on line 34 SKU is created and live Notice: Use of undefined constant txt - assumed 'txt' in /in/rTdgM on line 34 Colors available Notice: Use of undefined constant txt - assumed 'txt' in /in/rTdgM on line 34 Subject line Notice: Use of undefined constant txt - assumed 'txt' in /in/rTdgM on line 34 Coupon code Notice: Use of undefined constant txt - assumed 'txt' in /in/rTdgM on line 34 Coupon code - start date Notice: Use of undefined constant txt - assumed 'txt' in /in/rTdgM on line 34 Disclaimer verbiage within email Notice: Use of undefined constant txt - assumed 'txt' in /in/rTdgM on line 34 Disclaimer verbiage within MailChimp Notice: Use of undefined constant txt - assumed 'txt' in /in/rTdgM on line 34 Distributing to the correct email lists Notice: Use of undefined constant txt - assumed 'txt' in /in/rTdgM on line 34 Masthead Creative and Copy Notice: Use of undefined constant txt - assumed 'txt' in /in/rTdgM on line 34 Promo Graphic Creative and Copy
Output for 5.0.0 - 5.1.6
Fatal error: Call to undefined function json_decode() in /in/rTdgM 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/rTdgM 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/rTdgM 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/rTdgM on line 3