3v4l.org

run code in 300+ PHP versions simultaneously
<?php function gen1() { yield 1; yield 2; yield 3; } function gen2(bool $opt) { if ($opt) return gen1(); yield 4; yield 5; yield 6; } gen2(true); gen2(false);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/D8QQd
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   INIT_FCALL                                               'gen2'
          1        SEND_VAL                                                 <true>
          2        DO_FCALL                                      0          
   21     3        INIT_FCALL                                               'gen2'
          4        SEND_VAL                                                 <false>
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Function gen1:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/D8QQd
function name:  gen1
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   GENERATOR_CREATE                                         
    5     1        YIELD                                                    1
    6     2        YIELD                                                    2
    7     3        YIELD                                                    3
    8     4      > GENERATOR_RETURN                                         

End of function gen1

Function gen2:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 6
Branch analysis from position: 3
1 jumps found. (Code = 161) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/D8QQd
function name:  gen2
number of ops:  10
compiled vars:  !0 = $opt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
          1        GENERATOR_CREATE                                         
   12     2      > JMPZ                                                     !0, ->6
   13     3    >   INIT_FCALL                                               'gen1'
          4        DO_FCALL                                      0  $1      
          5      > GENERATOR_RETURN                                         
   15     6    >   YIELD                                                    4
   16     7        YIELD                                                    5
   17     8        YIELD                                                    6
   18     9      > GENERATOR_RETURN                                         

End of function gen2

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.88 ms | 1399 KiB | 16 Q