3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = function($cnt) { for($i=1;$i<$cnt;$i++) { yield($i); } }; while($b = $a(100)) { echo $b; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 9, Position 2 = 3
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 9, Position 2 = 3
Branch analysis from position: 9
Branch analysis from position: 3
filename:       /in/q4aVf
function name:  (null)
number of ops:  10
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fq4aVf%3A2%240'
          1        ASSIGN                                                   !0, ~2
    8     2      > JMP                                                      ->4
    9     3    >   ECHO                                                     !1
    8     4    >   INIT_DYNAMIC_CALL                                        !0
          5        SEND_VAL_EX                                              100
          6        DO_FCALL                                      0  $4      
          7        ASSIGN                                           ~5      !1, $4
          8      > JMPNZ                                                    ~5, ->3
   10     9    > > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Fq4aVf%3A2%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 4
Branch analysis from position: 8
1 jumps found. (Code = 161) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 4
Branch analysis from position: 8
Branch analysis from position: 4
filename:       /in/q4aVf
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $cnt, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        GENERATOR_CREATE                                         
    3     2        ASSIGN                                                   !1, 1
          3      > JMP                                                      ->6
    4     4    >   YIELD                                                    !1
    3     5        PRE_INC                                                  !1
          6    >   IS_SMALLER                                               !1, !0
          7      > JMPNZ                                                    ~5, ->4
    6     8    > > GENERATOR_RETURN                                         

End of function %00%7Bclosure%7D%2Fin%2Fq4aVf%3A2%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.03 ms | 1395 KiB | 13 Q