3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test(): int { try { return 5; } finally { try { // NOOP } catch(Exception $e) { // NOOP var_export($e); die("catch"); } catch(TypeError $e) { var_dump($e); die("typeerror"); } finally { // NOOP die("finally"); } } } $a = test(); if($a !== 5) { echo "FAILED: expected 5, recieved ", var_export($a), PHP_EOL; } else { echo "Passed", PHP_EOL; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 12
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8GgOe
function name:  (null)
number of ops:  15
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   INIT_FCALL                                               'test'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN                                                   !0, $1
   26     3        IS_NOT_IDENTICAL                                         !0, 5
          4      > JMPZ                                                     ~3, ->12
   27     5    >   ECHO                                                     'FAILED%3A+expected+5%2C+recieved+'
          6        INIT_FCALL                                               'var_export'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $4      
          9        ECHO                                                     $4
         10        ECHO                                                     '%0A'
         11      > JMP                                                      ->14
   29    12    >   ECHO                                                     'Passed'
         13        ECHO                                                     '%0A'
   30    14    > > RETURN                                                   1

Function test:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 162) Position 1 = 4, Position 2 = 1
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 16
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 = 79) 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 = 163) Position 1 = -2
Branch analysis from position: 1
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 5
Branch analysis from position: 5
2 jumps found. (Code = 107) Position 1 = 6, Position 2 = 11
Branch analysis from position: 6
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 11
2 jumps found. (Code = 107) Position 1 = 12, Position 2 = -2
Branch analysis from position: 12
1 jumps found. (Code = 79) Position 1 = -2
Found catch point at position: 11
Branch analysis from position: 11
filename:       /in/8GgOe
function name:  test
number of ops:  23
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E > > FAST_CALL                                                ->4
          1    > > RETURN                                                   5
    6     2*       FAST_CALL                                                ->4
          3*       JMP                                                      ->21
    7     4    > > JMP                                                      ->16
    9     5  E > > CATCH                                                    'Exception', ->11
   11     6    >   INIT_FCALL                                               'var_export'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
   12     9      > EXIT                                                     'catch'
         10*       JMP                                                      ->16
   14    11  E > > CATCH                                       last         'TypeError'
   15    12    >   INIT_FCALL                                               'var_dump'
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                                 
   16    15      > EXIT                                                     'typeerror'
   18    16    > > FAST_CALL                                                ->18
         17    > > JMP                                                      ->20
   20    18    > > EXIT                                                     'finally'
         19*       FAST_RET                                                 
         20    > > FAST_RET                                                 
   23    21*       VERIFY_RETURN_TYPE                                       
         22*     > RETURN                                                   null

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.38 ms | 1394 KiB | 18 Q