3v4l.org

run code in 500+ 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

Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/l9BS4
function name:  (null)
number of ops:  12
compiled vars:  !0 = $json
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, '%7B%0A%09%22id%22%3A+1154%2C%0A%09%22parent_id%22%3A+0%2C%0A%09%22status%22%3A+%22pending%22%2C%0A%09%22currency%22%3A+%22EUR%22%2C%0A%09%22version%22%3A+%223.2.3%22%2C%0A%09%22prices_include_tax%22%3A+true%2C%0A%09%22date_created%22%3A+%7B%0A%09%09%22date%22%3A+%222017-12-15+15%3A58%3A42.000000%22%2C%0A%09%09%22timezone_type%22%3A+1%2C%0A%09%09%22timezone%22%3A+%22%2B00%3A00%22%0A%09%7D%2C%0A%09%22date_modified%22%3A+%7B%0A%09%09%22date%22%3A+%222017-12-15+15%3A58%3A42.000000%22%2C%0A%09%09%22timezone_type%22%3A+1%2C%0A%09%09%22timezone%22%3A+%22%2B00%3A00%22%0A%09%7D%2C%0A%09%22discount_total%22%3A+%220%22%2C%0A%09%22discount_tax%22%3A+%220%22%2C%0A%09%22shipping_total%22%3A+%220%22%2C%0A%09%22shipping_tax%22%3A+%220%22%2C%0A%09%22cart_tax%22%3A+%220%22%2C%0A%09%22total%22%3A+%226.50%22%2C%0A%09%22total_tax%22%3A+%220%22%2C%0A%09%22customer_id%22%3A+0%2C%0A%09%22order_key%22%3A+%22wc_order_5a33f1321ba43%22%2C%0A%09%22billing%22%3A+%7B%0A%09%09%22first_name%22%3A+%22Peter%22%2C%0A%09%09%22last_name%22%3A+%22Parker%22%2C%0A%09%09%22company%22%3A+%22%22%2C%0A%09%09%22address_1%22%3A+%22Baker+Str.%22%2C%0A%09%09%22address_2%22%3A+%222%22%2C%0A%09%09%22city%22%3A+%22London%22%2C%0A%09%09%22state%22%3A+%22%22%2C%0A%09%09%22postcode%22%3A+%2250668%22%2C%0A%09%09%22country%22%3A+%22DE%22%2C%0A%09%09%22email%22%3A+%22something%40gmail.com%22%2C%0A%09%09%22phone%22%3A+%2201627423%22%0A%09%7D%2C%0A%09%22shipping%22%3A+%7B%0A%09%09%22first_name%22%3A+%22Peter%22%2C%0A%09%09%22last_name%22%3A+%22Parker%22%2C%0A%09%09%22company%22%3A+%22%22%2C%0A%09%09%22address_1%22%3A+%22Baker+Str.%22%2C%0A%09%09%22address_2%22%3A+%222%22%2C%0A%09%09%22city%22%3A+%22London%22%2C%0A%09%09%22state%22%3A+%22%22%2C%0A%09%09%22postcode%22%3A+%2250668%22%2C%0A%09%09%22country%22%3A+%22DE%22%0A%09%7D%2C%0A%09%22payment_method%22%3A+%22cod%22%2C%0A%09%22payment_method_title%22%3A+%22Bei+Abholung%22%2C%0A%09%22transaction+_id%22%3A+%22%22%2C%0A%09%22customer_ip_address%22%3A+%22...%22%2C%0A%09%22customer_user_agent%22%3A+%22mozilla%2F5.0+%28macintosh%3B+intel+mac+os+x+10_13_2%29+applewebkit%2F537.36+%28khtml%2C+like+gecko%29+chrome%2Fblabla+safari%2F537.36%22%2C%0A%09%22created_via%22%3A+%22checkout%22%2C%0A%09%22customer_note%22%3A+%22%22%2C%0A%09%22date_completed%22%3A+null%2C%0A%09%22date_paid%22%3A+null%2C%0A%09%22cart_hash%22%3A+%22be97db19eba58864b9166961ce22a706%22%2C%0A%09%22number%22%3A+%221154%22%2C%0A%09%22meta_data%22%3A+%5B%7B%0A%09%09%22id%22%3A+4731%2C%0A%09%09%22key%22%3A+%22_billing_title%22%2C%0A%09%09%22value%22%3A+%221%22%0A%09%7D%2C+%7B%0A%09%09%22id%22%3A+4732%2C%0A%09%09%22key%22%3A+%22_shipping_title%22%2C%0A%09%09%22value%22%3A+%221%22%0A%09%7D%5D%2C%0A%09%22line_items%22%3A+%7B%0A%09%09%2218%22%3A+%7B%7D%0A%09%7D%2C%0A%09%22tax_lines%22%3A+%5B%5D%2C%0A%09%22shipping_lines%22%3A+%7B%0A%09%09%2219%22%3A+%7B%7D%0A%09%7D%2C%0A%09%22fee_lines%22%3A+%5B%5D%2C%0A%09%22coupon_lines%22%3A+%5B%5D%0A%7D'
   83     1        ECHO                                                         '%3Ch2%3EOrder+Details%3C%2Fh2%3E%0A'
   84     2        INIT_FCALL_BY_NAME                                           'order_details'
          3        INIT_FCALL                                                   'json_decode'
          4        SEND_VAR                                                     !0
          5        SEND_VAL                                                     <true>
          6        DO_ICALL                                             $2      
          7        SEND_VAR_NO_REF_EX                                           $2
          8        SEND_VAL_EX                                                  null
          9        DO_FCALL                                          0  $3      
         10        ECHO                                                         $3
   96    11      > RETURN                                                       1

Function order_details:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 34
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 34
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 22
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 34
filename:       /in/l9BS4
function name:  order_details
number of ops:  37
compiled vars:  !0 = $items, !1 = $str, !2 = $item, !3 = $key
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   86     0  E >   RECV                                                 !0      
          1        RECV_INIT                                            !1      null
   87     2      > FE_RESET_R                                           $4      !0, ->34
          3    > > FE_FETCH_R                                           ~5      $4, !2, ->34
          4    >   ASSIGN                                                       !3, ~5
   88     5        TYPE_CHECK                                      128          !2
          6      > JMPZ                                                         ~7, ->22
   89     7    >   INIT_FCALL                                                   'ucwords'
          8        FRAMELESS_ICALL_3                str_replace         ~8      '_', '+'
          9        OP_DATA                                                      !3
         10        SEND_VAL                                                     ~8
         11        DO_ICALL                                             $9      
         12        CONCAT                                               ~10     '%0A%3Ch3%3E', $9
         13        CONCAT                                               ~11     ~10, '%3C%2Fh3%3E'
         14        CONCAT                                               ~12     ~11, '%0A'
         15        ASSIGN_OP                                         8          !1, ~12
   90    16        INIT_FCALL_BY_NAME                                           'order_details'
         17        SEND_VAR_EX                                                  !2
         18        SEND_VAR_EX                                                  !1
         19        DO_FCALL                                          0  $14     
         20        ASSIGN_OP                                         8          !1, $14
   88    21      > JMP                                                          ->33
   92    22    >   INIT_FCALL                                                   'ucwords'
         23        FRAMELESS_ICALL_3                str_replace         ~16     '_', '+'
         24        OP_DATA                                                      !3
         25        SEND_VAL                                                     ~16
         26        DO_ICALL                                             $17     
         27        CONCAT                                               ~18     '%3Cb%3E', $17
         28        CONCAT                                               ~19     ~18, '%3C%2Fb%3E%3A+'
         29        CONCAT                                               ~20     ~19, !2
         30        CONCAT                                               ~21     ~20, '%3C%2Fbr%3E'
         31        CONCAT                                               ~22     ~21, '%0A'
         32        ASSIGN_OP                                         8          !1, ~22
   87    33    > > JMP                                                          ->3
         34    >   FE_FREE                                                      $4
   95    35      > RETURN                                                       !1
   96    36*     > RETURN                                                       null

End of function order_details

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
196.02 ms | 8329 KiB | 15 Q