3v4l.org

run code in 300+ PHP versions simultaneously
<?php $prices = array_column($ShoppingCart, 'Price'); array_walk($prices, function(&$price, $i) { if($i) $price *= .75; }); $total = array_sum($prices);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PSIEe
function name:  (null)
number of ops:  15
compiled vars:  !0 = $prices, !1 = $ShoppingCart, !2 = $total
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'array_column'
          1        SEND_VAR                                                 !1
          2        SEND_VAL                                                 'Price'
          3        DO_ICALL                                         $3      
          4        ASSIGN                                                   !0, $3
    4     5        INIT_FCALL                                               'array_walk'
          6        SEND_REF                                                 !0
          7        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FPSIEe%3A4%240'
          8        SEND_VAL                                                 ~5
          9        DO_ICALL                                                 
    5    10        INIT_FCALL                                               'array_sum'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                         $7      
         13        ASSIGN                                                   !2, $7
         14      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FPSIEe%3A4%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 4
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
filename:       /in/PSIEe
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $price, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2      > JMPZ                                                     !1, ->4
          3    >   ASSIGN_OP                                     3          !0, 0.75
          4    > > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FPSIEe%3A4%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.34 ms | 1395 KiB | 19 Q