3v4l.org

run code in 500+ PHP versions simultaneously
<?php $sum = fn($a, $sum) => empty($a) ? 0 : array_pop($a) + $sum($a, $sum); print $sum([1,2,3], $sum); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BYubA
function name:  (null)
number of ops:  8
compiled vars:  !0 = $sum
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   DECLARE_LAMBDA_FUNCTION                              ~1      [0]
          1        ASSIGN                                                       !0, ~1
    5     2        INIT_DYNAMIC_CALL                                            !0
          3        SEND_VAL_EX                                                  <array>
          4        SEND_VAR_EX                                                  !0
          5        DO_FCALL                                          0  $3      
          6        ECHO                                                         $3
    7     7      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BYubA
function name:  {closure:/in/BYubA:3}
number of ops:  17
compiled vars:  !0 = $a, !1 = $sum
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
          2        ISSET_ISEMPTY_CV                                             !0
          3      > JMPZ                                                         ~2, ->6
          4    >   QM_ASSIGN                                            ~3      0
          5      > JMP                                                          ->15
          6    >   INIT_FCALL                                                   'array_pop'
          7        SEND_REF                                                     !0
          8        DO_ICALL                                             $4      
          9        INIT_DYNAMIC_CALL                                            !1
         10        SEND_VAR_EX                                                  !0
         11        SEND_VAR_EX                                                  !1
         12        DO_FCALL                                          0  $5      
         13        ADD                                                  ~6      $4, $5
         14        QM_ASSIGN                                            ~3      ~6
         15    > > RETURN                                                       ~3
         16*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
155.6 ms | 1469 KiB | 14 Q