3v4l.org

run code in 300+ PHP versions simultaneously
<?php $content = '{"ORDERLIST":"{\"ORDER_LIST\":[{\"order_id\":\"1755\",\"uname\":\"jordan\",\"prod_name\":\"ABC\",\"quantity\":\"1\",\"branch\":\"Dapitan\",\"totalPrice\":\"23500\"]}"}'; $response = json_decode($content, true); $orderlist = json_decode($response['ORDERLIST'], true); //var_dump($orderlist); //count(var_export($orderlist)); $count = count($orderlist); echo "Count: $count"; //foreach($orderlist AS $row){ // echo $row[0]['order_id']; //echo $row[0]['uname']; //echo $row[0]['prod_name']; //echo $row[0]['quantity']; //echo $row[0]['branch']; //echo $row[0]['totalPrice']; //}
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3Cjt0
function name:  (null)
number of ops:  18
compiled vars:  !0 = $content, !1 = $response, !2 = $orderlist, !3 = $count
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%7B%22ORDERLIST%22%3A%22%7B%5C%22ORDER_LIST%5C%22%3A%5B%7B%5C%22order_id%5C%22%3A%5C%221755%5C%22%2C%5C%22uname%5C%22%3A%5C%22jordan%5C%22%2C%5C%22prod_name%5C%22%3A%5C%22ABC%5C%22%2C%5C%22quantity%5C%22%3A%5C%221%5C%22%2C%5C%22branch%5C%22%3A%5C%22Dapitan%5C%22%2C%5C%22totalPrice%5C%22%3A%5C%2223500%5C%22%5D%7D%22%7D'
    3     1        INIT_FCALL                                               'json_decode'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 <true>
          4        DO_ICALL                                         $5      
          5        ASSIGN                                                   !1, $5
    4     6        INIT_FCALL                                               'json_decode'
          7        FETCH_DIM_R                                      ~7      !1, 'ORDERLIST'
          8        SEND_VAL                                                 ~7
          9        SEND_VAL                                                 <true>
         10        DO_ICALL                                         $8      
         11        ASSIGN                                                   !2, $8
    7    12        COUNT                                            ~10     !2
         13        ASSIGN                                                   !3, ~10
    8    14        NOP                                                      
         15        FAST_CONCAT                                      ~12     'Count%3A+', !3
         16        ECHO                                                     ~12
   16    17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.82 ms | 1395 KiB | 15 Q