3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyTrueException extends \Exception { } class MyFalseException extends \Exception { } function doSomething($var) { ($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/15b2h
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   INIT_FCALL                                               'dosomething'
          1        SEND_VAL                                                 <true>
          2        DO_FCALL                                      0          
          3      > JMP                                                      ->9
   20     4  E > > CATCH                                                    'MyTrueException', ->7
   22     5    >   ECHO                                                     'got+true'
          6      > JMP                                                      ->9
   23     7  E > > CATCH                                       last         'MyFalseException'
   25     8    >   ECHO                                                     'got+false'
   26     9    > > RETURN                                                   1

Function dosomething:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 7
Branch analysis from position: 2
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/15b2h
function name:  doSomething
number of ops:  13
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   13     1      > JMPZ                                                     !0, ->7
          2    >   NEW                                              $1      'MyTrueException'
          3        DO_FCALL                                      0          
          4      > THROW                                         1          $1
          5*       QM_ASSIGN                                        ~3      <true>
          6*       JMP                                                      ->11
          7    >   NEW                                              $4      'MyFalseException'
          8        DO_FCALL                                      0          
          9      > THROW                                         1          $4
         10*       QM_ASSIGN                                        ~3      <true>
         11*       FREE                                                     ~3
   14    12*     > 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:
150.19 ms | 1399 KiB | 14 Q