3v4l.org

run code in 300+ PHP versions simultaneously
<?php $items = array(array('amount' => 50), array('amount' => 60), array('amount' => 100), array('amount' => 25), array('amount' => 30), array('amount' => 89), array('amount' => 90), array('amount' => 120), array('amount' => 16), array('amount' => 38)); $itemsSum = 0; array_walk($items, function ($item) use (&$itemsSum) { $itemsSum += $item['amount']; }); echo $itemsSum;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rRpoi
function name:  (null)
number of ops:  10
compiled vars:  !0 = $items, !1 = $itemsSum
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        ASSIGN                                                   !1, 0
    6     2        INIT_FCALL                                               'array_walk'
          3        SEND_REF                                                 !0
          4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FrRpoi%3A6%240'
          5        BIND_LEXICAL                                             ~4, !1
    8     6        SEND_VAL                                                 ~4
          7        DO_ICALL                                                 
    9     8        ECHO                                                     !1
          9      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FrRpoi%3A6%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rRpoi
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $item, !1 = $itemsSum
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
    7     2        FETCH_DIM_R                                      ~2      !0, 'amount'
          3        ASSIGN_OP                                     1          !1, ~2
    8     4      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FrRpoi%3A6%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.77 ms | 1395 KiB | 15 Q