3v4l.org

run code in 300+ PHP versions simultaneously
<?php $duty = array(); $duty['quantity'] = 1; $duty['sku'] = '20-76-01-0040-000-000'; $duty['name'] = 'Duties'; $duty['price'] = array( "amountExcludingTax" => 12.99, "amountIncludingTax" => 12.99, "tax" => 0 ); $data['rows'][] = $duty; $service = array(); $service['quantity'] = 1; $service['sku'] = '20-76-01-0050-000-000'; $service['name'] = 'Service Fees'; $service['price'] = array( "amountExcludingTax" => 20.50, "amountIncludingTax" => 20.50, "tax" => 0 ); $data['rows'][] = $service; echo json_encode($duty);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ec0Mr
function name:  (null)
number of ops:  29
compiled vars:  !0 = $duty, !1 = $data, !2 = $service
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN_DIM                                               !0, 'quantity'
          2        OP_DATA                                                  1
    5     3        ASSIGN_DIM                                               !0, 'sku'
          4        OP_DATA                                                  '20-76-01-0040-000-000'
    6     5        ASSIGN_DIM                                               !0, 'name'
          6        OP_DATA                                                  'Duties'
    7     7        ASSIGN_DIM                                               !0, 'price'
    8     8        OP_DATA                                                  <array>
   12     9        FETCH_DIM_W                                      $8      !1, 'rows'
         10        ASSIGN_DIM                                               $8
         11        OP_DATA                                                  !0
   15    12        ASSIGN                                                   !2, <array>
   16    13        ASSIGN_DIM                                               !2, 'quantity'
         14        OP_DATA                                                  1
   17    15        ASSIGN_DIM                                               !2, 'sku'
         16        OP_DATA                                                  '20-76-01-0050-000-000'
   18    17        ASSIGN_DIM                                               !2, 'name'
         18        OP_DATA                                                  'Service+Fees'
   19    19        ASSIGN_DIM                                               !2, 'price'
   20    20        OP_DATA                                                  <array>
   24    21        FETCH_DIM_W                                      $15     !1, 'rows'
         22        ASSIGN_DIM                                               $15
         23        OP_DATA                                                  !2
   27    24        INIT_FCALL                                               'json_encode'
         25        SEND_VAR                                                 !0
         26        DO_ICALL                                         $17     
         27        ECHO                                                     $17
         28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.39 ms | 1399 KiB | 15 Q