3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test() { if (1 < 0) { yield 'a'; } } function test2() { yield 'a'; yield 'b'; } $test = test(); $test2 = test2(); var_dump($test->valid());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BO9ah
function name:  (null)
number of ops:  12
compiled vars:  !0 = $test, !1 = $test2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_FCALL                                               'test'
          1        DO_FCALL                                      0  $2      
          2        ASSIGN                                                   !0, $2
   17     3        INIT_FCALL                                               'test2'
          4        DO_FCALL                                      0  $4      
          5        ASSIGN                                                   !1, $4
   19     6        INIT_FCALL                                               'var_dump'
          7        INIT_METHOD_CALL                                         !0, 'valid'
          8        DO_FCALL                                      0  $6      
          9        SEND_VAR                                                 $6
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

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

End of function test

Function test2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/BO9ah
function name:  test2
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   GENERATOR_CREATE                                         
   12     1        YIELD                                                    'a'
   13     2        YIELD                                                    'b'
   14     3      > GENERATOR_RETURN                                         

End of function test2

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.17 ms | 943 KiB | 19 Q