3v4l.org

run code in 500+ PHP versions simultaneously
<?php $a = range(0, 250_000); $b = range(250_000, 500_000); $gen = function(array ...$input):iterable{foreach($input as $it) {yield from $it;}}; $start = microtime(true); foreach($gen($a, $b) as $key => $item){ // } $elapsed = microtime(true) - $start; var_dump($elapsed);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 21, Position 2 = 24
Branch analysis from position: 21
2 jumps found. (Code = 78) Position 1 = 22, Position 2 = 24
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/Ymksm
function name:  (null)
number of ops:  34
compiled vars:  !0 = $a, !1 = $b, !2 = $gen, !3 = $start, !4 = $item, !5 = $key, !6 = $elapsed
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                                   'range'
          1        SEND_VAL                                                     0
          2        SEND_VAL                                                     250000
          3        DO_ICALL                                             $7      
          4        ASSIGN                                                       !0, $7
    4     5        INIT_FCALL                                                   'range'
          6        SEND_VAL                                                     250000
          7        SEND_VAL                                                     500000
          8        DO_ICALL                                             $9      
          9        ASSIGN                                                       !1, $9
    7    10        DECLARE_LAMBDA_FUNCTION                              ~11     [0]
         11        ASSIGN                                                       !2, ~11
    9    12        INIT_FCALL                                                   'microtime'
         13        SEND_VAL                                                     <true>
         14        DO_ICALL                                             $13     
         15        ASSIGN                                                       !3, $13
   10    16        INIT_DYNAMIC_CALL                                            !2
         17        SEND_VAR_EX                                                  !0
         18        SEND_VAR_EX                                                  !1
         19        DO_FCALL                                          0  $15     
         20      > FE_RESET_R                                           $16     $15, ->24
         21    > > FE_FETCH_R                                           ~17     $16, !4, ->24
         22    >   ASSIGN                                                       !5, ~17
         23      > JMP                                                          ->21
         24    >   FE_FREE                                                      $16
   13    25        INIT_FCALL                                                   'microtime'
         26        SEND_VAL                                                     <true>
         27        DO_ICALL                                             $19     
         28        SUB                                                  ~20     $19, !3
         29        ASSIGN                                                       !6, ~20
   14    30        INIT_FCALL                                                   'var_dump'
         31        SEND_VAR                                                     !6
         32        DO_ICALL                                                     
         33      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 7
1 jumps found. (Code = 161) Position 1 = -2
Branch analysis from position: 7
filename:       /in/Ymksm
function name:  {closure:/in/Ymksm:7}
number of ops:  9
compiled vars:  !0 = $input, !1 = $it
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   RECV_VARIADIC                                        !0      
          1        GENERATOR_CREATE                                             
          2      > FE_RESET_R                                           $2      !0, ->7
          3    > > FE_FETCH_R                                                   $2, !1, ->7
          4    >   YIELD_FROM                                           ~3      !1
          5        FREE                                                         ~3
          6      > JMP                                                          ->3
          7    >   FE_FREE                                                      $2
          8      > GENERATOR_RETURN                                             

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
159.1 ms | 1309 KiB | 16 Q