3v4l.org

run code in 300+ PHP versions simultaneously
<?php function cExceptionHandler($exception) { if ($exception instanceof c_Exception_Exit) { $msg = $exception->getMessage(); if ($msg) { echo $msg; } exit(); } elseif ($exception instanceof c_Exception_Fatal) { die($exception->getMessage()); } restore_exception_handler(); if (version_compare(PHP_VERSION, '5.3.0', '>=')) { $class = get_class($exception); throw new $class($exception->getMessage(), $exception->getCode(), $exception); } throw $exception; } set_exception_handler('cExceptionHandler'); throw new Exception('test');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/3R4RJ
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   INIT_FCALL                                               'set_exception_handler'
          1        SEND_VAL                                                 'cExceptionHandler'
          2        DO_ICALL                                                 
   29     3        NEW                                              $1      'Exception'
          4        SEND_VAL_EX                                              'test'
          5        DO_FCALL                                      0          
          6      > THROW                                         0          $1
          7*     > RETURN                                                   1

Function cexceptionhandler:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 10
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 8
Branch analysis from position: 7
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 8
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 15
Branch analysis from position: 12
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 36
Branch analysis from position: 23
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 36
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/3R4RJ
function name:  cExceptionHandler
number of ops:  38
compiled vars:  !0 = $exception, !1 = $msg, !2 = $class
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    5     1        INSTANCEOF                                               !0, 'c_Exception_Exit'
          2      > JMPZ                                                     ~3, ->10
    6     3    >   INIT_METHOD_CALL                                         !0, 'getMessage'
          4        DO_FCALL                                      0  $4      
          5        ASSIGN                                                   !1, $4
    8     6      > JMPZ                                                     !1, ->8
    9     7    >   ECHO                                                     !1
   12     8    > > EXIT                                                     
          9*       JMP                                                      ->15
   13    10    >   INSTANCEOF                                               !0, 'c_Exception_Fatal'
         11      > JMPZ                                                     ~6, ->15
   14    12    >   INIT_METHOD_CALL                                         !0, 'getMessage'
         13        DO_FCALL                                      0  $7      
         14      > EXIT                                                     $7
   18    15    >   INIT_FCALL                                               'restore_exception_handler'
         16        DO_ICALL                                                 
   20    17        INIT_FCALL                                               'version_compare'
         18        SEND_VAL                                                 '8.0.0'
         19        SEND_VAL                                                 '5.3.0'
         20        SEND_VAL                                                 '%3E%3D'
         21        DO_ICALL                                         $9      
         22      > JMPZ                                                     $9, ->36
   21    23    >   GET_CLASS                                        ~10     !0
         24        ASSIGN                                                   !2, ~10
   22    25        FETCH_CLASS                                   0  $12     !2
         26        NEW                                              $13     $12
         27        INIT_METHOD_CALL                                         !0, 'getMessage'
         28        DO_FCALL                                      0  $14     
         29        SEND_VAR_NO_REF_EX                                       $14
         30        INIT_METHOD_CALL                                         !0, 'getCode'
         31        DO_FCALL                                      0  $15     
         32        SEND_VAR_NO_REF_EX                                       $15
         33        SEND_VAR_EX                                              !0
         34        DO_FCALL                                      0          
         35      > THROW                                         0          $13
   25    36    > > THROW                                         0          !0
   26    37*     > RETURN                                                   null

End of function cexceptionhandler

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.84 ms | 1400 KiB | 19 Q