3v4l.org

run code in 500+ PHP versions simultaneously
<?php function sumNumbers(iterable $numbers, int $limit): float { $sum = 0; $i = 0; foreach ($numbers as $number) { if ($i === $limit) { break; } $sum += $number; $i++; } return (float) $sum; } echo sumNumbers((function () { $i = 0; $k = 1; yield $k; while(true) { $k = $i + $k; $i = $k - $i; yield $k; } })(), 10);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4HsEK
function name:  (null)
number of ops:  9
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   18     0  E >   INIT_FCALL                                                   'sumnumbers'
          1        DECLARE_LAMBDA_FUNCTION                              ~0      [0]
   28     2        INIT_DYNAMIC_CALL                                            ~0
          3        DO_FCALL                                          0  $1      
          4        SEND_VAR                                                     $1
          5        SEND_VAL                                                     10
   18     6        DO_FCALL                                          0  $2      
   28     7        ECHO                                                         $2
          8      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 5
Branch analysis from position: 11
1 jumps found. (Code = 161) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 5
Branch analysis from position: 11
Branch analysis from position: 5
filename:       /in/4HsEK
function name:  {closure:/in/4HsEK:18}
number of ops:  12
compiled vars:  !0 = $i, !1 = $k
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   18     0  E >   GENERATOR_CREATE                                             
   19     1        ASSIGN                                                       !0, 0
   20     2        ASSIGN                                                       !1, 1
   21     3        YIELD                                                        !1
   22     4      > JMP                                                          ->10
   24     5    >   ADD                                                  ~5      !0, !1
          6        ASSIGN                                                       !1, ~5
   25     7        SUB                                                  ~7      !1, !0
          8        ASSIGN                                                       !0, ~7
   26     9        YIELD                                                        !1
   22    10    > > JMPNZ                                                        <true>, ->5
   28    11    > > GENERATOR_RETURN                                             

End of Dynamic Function 0

Function sumnumbers:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 12
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 12
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 9
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 12
Branch analysis from position: 12
filename:       /in/4HsEK
function name:  sumNumbers
number of ops:  18
compiled vars:  !0 = $numbers, !1 = $limit, !2 = $sum, !3 = $i, !4 = $number
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
    4     2        ASSIGN                                                       !2, 0
    5     3        ASSIGN                                                       !3, 0
    6     4      > FE_RESET_R                                           $7      !0, ->12
          5    > > FE_FETCH_R                                                   $7, !4, ->12
    7     6    >   IS_IDENTICAL                                                 !3, !1
          7      > JMPZ                                                         ~8, ->9
    8     8    > > JMP                                                          ->12
   11     9    >   ASSIGN_OP                                         1          !2, !4
   12    10        PRE_INC                                                      !3
    6    11      > JMP                                                          ->5
         12    >   FE_FREE                                                      $7
   15    13        CAST                                              5  ~11     !2
         14        VERIFY_RETURN_TYPE                                           ~11
         15      > RETURN                                                       ~11
   16    16*       VERIFY_RETURN_TYPE                                           
         17*     > RETURN                                                       null

End of function sumnumbers

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
222.59 ms | 1994 KiB | 14 Q