3v4l.org

run code in 300+ PHP versions simultaneously
<?php class requestObject{} class TopconAPIException extends Exception {} class CreatePortalController { public function handleError($id,$error) { $this->error->add("$id"."$error"); } public function handleException($exception) { print_R(get_class_methods($exception)); echo $exception->getTraceAsString(); exit; $this->error->add("0".$exception); } public function view() { set_error_handler(array($this,'handleError')); set_exception_handler(array($this,'handleException')); throw new TopconAPIException('Some Exception!'); } } $d = new CreatePortalController(); $d->view();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HKS5H
function name:  (null)
number of ops:  6
compiled vars:  !0 = $d
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   NEW                                              $1      'CreatePortalController'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   28     3        INIT_METHOD_CALL                                         !0, 'view'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Class requestObject: [no user functions]
Class TopconAPIException: [no user functions]
Class CreatePortalController:
Function handleerror:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HKS5H
function name:  handleError
number of ops:  10
compiled vars:  !0 = $id, !1 = $error
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   10     2        FETCH_OBJ_R                                      ~2      'error'
          3        INIT_METHOD_CALL                                         ~2, 'add'
          4        CAST                                          6  ~3      !0
          5        CAST                                          6  ~4      !1
          6        CONCAT                                           ~5      ~3, ~4
          7        SEND_VAL_EX                                              ~5
          8        DO_FCALL                                      0          
   11     9      > RETURN                                                   null

End of function handleerror

Function handleexception:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/HKS5H
function name:  handleException
number of ops:  17
compiled vars:  !0 = $exception
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   13     1        INIT_FCALL                                               'print_r'
          2        INIT_FCALL                                               'get_class_methods'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $1      
          5        SEND_VAR                                                 $1
          6        DO_ICALL                                                 
   14     7        INIT_METHOD_CALL                                         !0, 'getTraceAsString'
          8        DO_FCALL                                      0  $3      
          9        ECHO                                                     $3
   15    10      > EXIT                                                     
   16    11*       FETCH_OBJ_R                                      ~4      'error'
         12*       INIT_METHOD_CALL                                         ~4, 'add'
         13*       CONCAT                                           ~5      '0', !0
         14*       SEND_VAL_EX                                              ~5
         15*       DO_FCALL                                      0          
   17    16*     > RETURN                                                   null

End of function handleexception

Function view:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/HKS5H
function name:  view
number of ops:  17
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   INIT_FCALL                                               'set_error_handler'
          1        FETCH_THIS                                       ~0      
          2        INIT_ARRAY                                       ~1      ~0
          3        ADD_ARRAY_ELEMENT                                ~1      'handleError'
          4        SEND_VAL                                                 ~1
          5        DO_ICALL                                                 
   21     6        INIT_FCALL                                               'set_exception_handler'
          7        FETCH_THIS                                       ~3      
          8        INIT_ARRAY                                       ~4      ~3
          9        ADD_ARRAY_ELEMENT                                ~4      'handleException'
         10        SEND_VAL                                                 ~4
         11        DO_ICALL                                                 
   22    12        NEW                                              $6      'TopconAPIException'
         13        SEND_VAL_EX                                              'Some+Exception%21'
         14        DO_FCALL                                      0          
         15      > THROW                                         0          $6
   23    16*     > RETURN                                                   null

End of function view

End of class CreatePortalController.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.74 ms | 1400 KiB | 21 Q