3v4l.org

run code in 300+ PHP versions simultaneously
<?php function bar() { try { throw new RuntimeException('Foo'); return new DateTime('now'); } catch (Throwable $e) { } finally { return new DateTime('-1 week'); } } try { var_dump(bar()); } catch (RuntimeException $e) { var_dump($e); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 6
Branch analysis from position: 6
2 jumps found. (Code = 107) Position 1 = 7, Position 2 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QgqSX
function name:  (null)
number of ops:  11
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'bar'
          2        DO_FCALL                                      0  $1      
          3        SEND_VAR                                                 $1
          4        DO_ICALL                                                 
          5      > JMP                                                      ->10
   16     6  E > > CATCH                                       last         'RuntimeException'
   17     7    >   INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
   18    10    > > RETURN                                                   1

Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
Found catch point at position: 10
Branch analysis from position: 10
2 jumps found. (Code = 107) Position 1 = 11, Position 2 = -2
Branch analysis from position: 11
2 jumps found. (Code = 162) Position 1 = 13, Position 2 = 12
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QgqSX
function name:  bar
number of ops:  20
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   NEW                                              $2      'RuntimeException'
          1        SEND_VAL_EX                                              'Foo'
          2        DO_FCALL                                      0          
          3      > THROW                                         0          $2
    7     4*       NEW                                              $4      'DateTime'
          5*       SEND_VAL_EX                                              'now'
          6*       DO_FCALL                                      0          
          7*       FAST_CALL                                                ->13
          8*       RETURN                                                   $4
          9*       JMP                                                      ->11
    8    10  E > > CATCH                                       last         'Throwable'
   10    11    > > FAST_CALL                                                ->13
         12    > > JMP                                                      ->19
   11    13    >   NEW                                              $6      'DateTime'
         14        SEND_VAL_EX                                              '-1+week'
         15        DO_FCALL                                      0          
         16        DISCARD_EXCEPTION                                        
         17      > RETURN                                                   $6
         18*       FAST_RET                                                 
   13    19    > > RETURN                                                   null

End of function bar

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.24 ms | 1399 KiB | 16 Q