3v4l.org

run code in 300+ PHP versions simultaneously
<?php function gen() { yield 0; yield ['a','b','c'][1]; yield 2; yield 3; yield $element = array('tom','dick','sally','sue')[2]; } try { $o = gen(); foreach($o as $g) { echo $g,' ', boolval($g),"\n"; } } catch (Exception $e) { echo "caught exception"; } finally { echo "Whatever, this line will always run"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 11
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 11
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 162) Position 1 = 17, Position 2 = 16
Branch analysis from position: 17
1 jumps found. (Code = 163) Position 1 = -2
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
Found catch point at position: 13
Branch analysis from position: 13
2 jumps found. (Code = 107) Position 1 = 14, Position 2 = -2
Branch analysis from position: 14
2 jumps found. (Code = 162) Position 1 = 17, Position 2 = 16
Branch analysis from position: 17
Branch analysis from position: 16
filename:       /in/C2gUZ
function name:  (null)
number of ops:  20
compiled vars:  !0 = $o, !1 = $g, !2 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'gen'
          1        DO_FCALL                                      0  $4      
          2        ASSIGN                                                   !0, $4
   13     3      > FE_RESET_R                                       $6      !0, ->11
          4    > > FE_FETCH_R                                               $6, !1, ->11
   14     5    >   ECHO                                                     !1
          6        ECHO                                                     '+'
          7        BOOL                                             ~7      !1
          8        ECHO                                                     ~7
          9        ECHO                                                     '%0A'
   13    10      > JMP                                                      ->4
         11    >   FE_FREE                                                  $6
         12      > JMP                                                      ->15
   17    13  E > > CATCH                                       last         'Exception'
   18    14    >   ECHO                                                     'caught+exception'
   20    15    > > FAST_CALL                                                ->17
         16    > > JMP                                                      ->19
   21    17    >   ECHO                                                     'Whatever%2C+this+line+will+always+run'
         18      > FAST_RET                                                 
   22    19    > > RETURN                                                   1

Function gen:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/C2gUZ
function name:  gen
number of ops:  10
compiled vars:  !0 = $element
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   GENERATOR_CREATE                                         
    3     1        YIELD                                                    0
    4     2        FETCH_DIM_R                                      ~2      <array>, 1
          3        YIELD                                                    ~2
    5     4        YIELD                                                    2
    6     5        YIELD                                                    3
    7     6        FETCH_DIM_R                                      ~6      <array>, 2
          7        ASSIGN                                           ~7      !0, ~6
          8        YIELD                                                    ~7
    9     9      > GENERATOR_RETURN                                         

End of function gen

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.63 ms | 1403 KiB | 14 Q