3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = '{ "id": 1154, "parent_id": 0, "status": "pending", "currency": "EUR", "version": "3.2.3", "prices_include_tax": true, "date_created": { "date": "2017-12-15 15:58:42.000000", "timezone_type": 1, "timezone": "+00:00" }, "date_modified": { "date": "2017-12-15 15:58:42.000000", "timezone_type": 1, "timezone": "+00:00" }, "discount_total": "0", "discount_tax": "0", "shipping_total": "0", "shipping_tax": "0", "cart_tax": "0", "total": "6.50", "total_tax": "0", "customer_id": 0, "order_key": "wc_order_5a33f1321ba43", "billing": { "first_name": "Peter", "last_name": "Parker", "company": "", "address_1": "Baker Str.", "address_2": "2", "city": "London", "state": "", "postcode": "50668", "country": "DE", "email": "something@gmail.com", "phone": "01627423" }, "shipping": { "first_name": "Peter", "last_name": "Parker", "company": "", "address_1": "Baker Str.", "address_2": "2", "city": "London", "state": "", "postcode": "50668", "country": "DE" }, "payment_method": "cod", "payment_method_title": "Bei Abholung", "transaction _id": "", "customer_ip_address": "...", "customer_user_agent": "mozilla/5.0 (macintosh; intel mac os x 10_13_2) applewebkit/537.36 (khtml, like gecko) chrome/blabla safari/537.36", "created_via": "checkout", "customer_note": "", "date_completed": null, "date_paid": null, "cart_hash": "be97db19eba58864b9166961ce22a706", "number": "1154", "meta_data": [{ "id": 4731, "key": "_billing_title", "value": "1" }, { "id": 4732, "key": "_shipping_title", "value": "1" }], "line_items": { "18": {} }, "tax_lines": [], "shipping_lines": { "19": {} }, "fee_lines": [], "coupon_lines": [] }'; echo '<h2>Order Details</h2>'.PHP_EOL; echo order_details(json_decode($json, true), null); function order_details($items, $str = null) { foreach ($items as $key => $item) { if (is_array($item)) { $str .= PHP_EOL.'<h3>'.ucwords(str_replace('_', ' ', $key)).'</h3>'.PHP_EOL; $str .= order_details($item, $str); } else { $str .= '<b>'.ucwords(str_replace('_', ' ', $key)).'</b>: '.$item.'</br>'.PHP_EOL; } } return $str; }

Abusive script

This script was stopped while abusing our resources


preferences:
87.79 ms | 7703 KiB | 5 Q