3v4l.org

run code in 500+ PHP versions simultaneously
<?php // suppose: $pri['base'] = 30000; $pri['com'] = 5000; // then $mst_per_off_base = bcmul($pri['base'],.01); // calculate 1% of the base price $gr[] = bcsub($pri['com'],$mst_per_off_base); // deduct the 1% off of the com echo array_sum($gr); // total of all after deduction
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3vFOM
function name:  (null)
number of ops:  24
compiled vars:  !0 = $pri, !1 = $mst_per_off_base, !2 = $gr
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   ASSIGN_DIM                                                   !0, 'base'
          1        OP_DATA                                                      30000
    5     2        ASSIGN_DIM                                                   !0, 'com'
          3        OP_DATA                                                      5000
    8     4        INIT_FCALL_BY_NAME                                           'bcmul'
          5        CHECK_FUNC_ARG                                               
          6        FETCH_DIM_FUNC_ARG                                   $5      !0, 'base'
          7        SEND_FUNC_ARG                                                $5
          8        SEND_VAL_EX                                                  0.01
          9        DO_FCALL                                          0  $6      
         10        ASSIGN                                                       !1, $6
    9    11        INIT_FCALL_BY_NAME                                           'bcsub'
         12        CHECK_FUNC_ARG                                               
         13        FETCH_DIM_FUNC_ARG                                   $9      !0, 'com'
         14        SEND_FUNC_ARG                                                $9
         15        SEND_VAR_EX                                                  !1
         16        DO_FCALL                                          0  $10     
         17        ASSIGN_DIM                                                   !2
         18        OP_DATA                                                      $10
   10    19        INIT_FCALL                                                   'array_sum'
         20        SEND_VAR                                                     !2
         21        DO_ICALL                                             $11     
         22        ECHO                                                         $11
         23      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
157.77 ms | 2529 KiB | 14 Q