3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyTrueException extends \Exception { } class MyFalseException extends \Exception { } function doSomething($var) { throw ($var) ? new MyTrueException() : 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/afWlg
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 = 6
Branch analysis from position: 2
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/afWlg
function name:  doSomething
number of ops:  11
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   13     1      > JMPZ                                                     !0, ->6
          2    >   NEW                                              $1      'MyTrueException'
          3        DO_FCALL                                      0          
          4        QM_ASSIGN                                        ~3      $1
          5      > JMP                                                      ->9
          6    >   NEW                                              $4      'MyFalseException'
          7        DO_FCALL                                      0          
          8        QM_ASSIGN                                        ~3      $4
          9    > > THROW                                         0          ~3
   14    10*     > 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:
154.38 ms | 1399 KiB | 14 Q