3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyTrueException extends \Exception { } class MyFalseException extends \Exception { } function doSomething($var) { if ($var) { throw new MyTrueException(); } throw new MyFalseException(); } try { doSomething(true); } catch (MyTrueException) { echo 'got true'; } catch (MyFalseException) { echo 'got false'; }
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: 4
Branch analysis from position: 4
2 jumps found. (Code = 107) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 7
2 jumps found. (Code = 107) Position 1 = 8, Position 2 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 7
Branch analysis from position: 7
filename:       /in/GpFSe
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   INIT_FCALL                                               'dosomething'
          1        SEND_VAL                                                 <true>
          2        DO_FCALL                                      0          
          3      > JMP                                                      ->9
   24     4  E > > CATCH                                                    'MyTrueException', ->7
   26     5    >   ECHO                                                     'got+true'
          6      > JMP                                                      ->9
   27     7  E > > CATCH                                       last         'MyFalseException'
   29     8    >   ECHO                                                     'got+false'
   30     9    > > RETURN                                                   1

Function dosomething:
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/GpFSe
function name:  doSomething
number of ops:  9
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   13     1      > JMPZ                                                     !0, ->5
   15     2    >   NEW                                              $1      'MyTrueException'
          3        DO_FCALL                                      0          
          4      > THROW                                         0          $1
   17     5    >   NEW                                              $3      'MyFalseException'
          6        DO_FCALL                                      0          
          7      > THROW                                         0          $3
   18     8*     > RETURN                                                   null

End of function dosomething

Class MyTrueException: [no user functions]
Class MyFalseException: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.18 ms | 1399 KiB | 14 Q