3v4l.org

run code in 500+ PHP versions simultaneously
<?php define('DO_RETURN', false); function execute() { try { throw new \Exception('root exception'); // throws exception } catch (\Throwable $e) { echo "[catch]"; // exception is handled somehow throw $e; // and rethrown return; // never called } finally { echo "[finally]"; // finally is handed if (DO_RETURN) return; // if return is here the thrown exception is ignored and silently scratched } } execute(); // the exception was rethrown, so should be thrown after finally
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aLqm4
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                                   'define'
          1        SEND_VAL                                                     'DO_RETURN'
          2        SEND_VAL                                                     <false>
          3        DO_ICALL                                                     
   19     4        INIT_FCALL                                                   'execute'
          5        DO_FCALL                                          0          
          6      > RETURN                                                       1

Function execute:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
Found catch point at position: 5
Branch analysis from position: 5
2 jumps found. (Code = 107) Position 1 = 6, Position 2 = -2
Branch analysis from position: 6
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/aLqm4
function name:  execute
number of ops:  19
compiled vars:  !0 = $e
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   NEW                                                  $2      'Exception'
          1        SEND_VAL_EX                                                  'root+exception'
          2        DO_FCALL                                          0          
          3      > THROW                                             0          $2
          4*       JMP                                                          ->10
    8     5  E > > CATCH                                           last         'Throwable'
    9     6    >   ECHO                                                         '%5Bcatch%5D'
   10     7      > THROW                                             0          !0
   11     8*       FAST_CALL                                                    ->12
          9*       RETURN                                                       null
   12    10*       FAST_CALL                                                    ->12
         11*       JMP                                                          ->18
   13    12*       ECHO                                                         '%5Bfinally%5D'
   14    13*       FETCH_CONSTANT                                       ~4      'DO_RETURN'
         14*       JMPZ                                                         ~4, ->17
   15    15*       DISCARD_EXCEPTION                                            
         16*       RETURN                                                       null
         17*       FAST_RET                                                     
   17    18*     > RETURN                                                       null

End of function execute

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
151.71 ms | 1319 KiB | 10 Q