3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface MyException { } class ImplementingException1 extends \Exception implements MyException { } class ImplementingException2 extends \Exception implements MyException { } function test($var) { if ($var) throw new ImplementingException1; throw new ImplementingException2; } try { test(true); } catch (MyException $e) { get_class($e); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
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/MHuve
function name:  (null)
number of ops:  10
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   DECLARE_CLASS                                            'implementingexception1', 'exception'
   11     1        DECLARE_CLASS                                            'implementingexception2', 'exception'
   23     2        INIT_FCALL                                               'test'
          3        SEND_VAL                                                 <true>
          4        DO_FCALL                                      0          
          5      > JMP                                                      ->9
   24     6  E > > CATCH                                       last         'MyException'
   25     7    >   GET_CLASS                                        ~2      !0
          8        FREE                                                     ~2
   26     9    > > RETURN                                                   1

Function test:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 5
Branch analysis from position: 2
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 5
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/MHuve
function name:  test
number of ops:  9
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   16     1      > JMPZ                                                     !0, ->5
   17     2    >   NEW                                              $1      'ImplementingException1'
          3        DO_FCALL                                      0          
          4      > THROW                                         0          $1
   19     5    >   NEW                                              $3      'ImplementingException2'
          6        DO_FCALL                                      0          
          7      > THROW                                         0          $3
   20     8*     > RETURN                                                   null

End of function test

Class MyException: [no user functions]
Class ImplementingException1: [no user functions]
Class ImplementingException2: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.3 ms | 1398 KiB | 14 Q