3v4l.org

run code in 300+ PHP versions simultaneously
<?php function fib() { try{ $a = 1; $b = 1; while(true) { $c = $a + $b; $a = $b; $b = $c; if ($c > 7) { throw new RuntimeException('Kaboom!'); } yield $c; }} finally { echo 'closing' . PHP_EOL; } } foreach(fib() as $f) { echo $f . PHP_EOL; }
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 = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/NNuCC
function name:  (null)
number of ops:  9
compiled vars:  !0 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   INIT_FCALL                                               'fib'
          1        DO_FCALL                                      0  $1      
          2      > FE_RESET_R                                       $2      $1, ->7
          3    > > FE_FETCH_R                                               $2, !0, ->7
   20     4    >   CONCAT                                           ~3      !0, '%0A'
          5        ECHO                                                     ~3
   19     6      > JMP                                                      ->3
          7    >   FE_FREE                                                  $2
   21     8      > RETURN                                                   1

Function fib:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 4
Branch analysis from position: 16
2 jumps found. (Code = 162) Position 1 = 18, Position 2 = 17
Branch analysis from position: 18
1 jumps found. (Code = 163) Position 1 = -2
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
1 jumps found. (Code = 161) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 14
Branch analysis from position: 10
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 4
Branch analysis from position: 16
Branch analysis from position: 4
filename:       /in/NNuCC
function name:  fib
number of ops:  21
compiled vars:  !0 = $a, !1 = $b, !2 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   GENERATOR_CREATE                                         
    4     1        ASSIGN                                                   !0, 1
    5     2        ASSIGN                                                   !1, 1
    6     3      > JMP                                                      ->15
    7     4    >   ADD                                              ~6      !0, !1
          5        ASSIGN                                                   !2, ~6
    8     6        ASSIGN                                                   !0, !1
    9     7        ASSIGN                                                   !1, !2
   10     8        IS_SMALLER                                               7, !2
          9      > JMPZ                                                     ~10, ->14
   11    10    >   NEW                                              $11     'RuntimeException'
         11        SEND_VAL_EX                                              'Kaboom%21'
         12        DO_FCALL                                      0          
         13      > THROW                                         0          $11
   13    14    >   YIELD                                                    !2
    6    15    > > JMPNZ                                                    <true>, ->4
   14    16    > > FAST_CALL                                                ->18
         17    > > JMP                                                      ->20
   15    18    >   ECHO                                                     'closing%0A'
         19      > FAST_RET                                                 
   17    20    > > GENERATOR_RETURN                                         

End of function fib

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.97 ms | 1403 KiB | 14 Q