3v4l.org

run code in 300+ PHP versions simultaneously
<?php class FunkyException extends Exception { protected $errors = []; public function __constructor ($message, $errors) { $this->message = $message; $this->errors = $errors; parent::__construct($message); } public function getErrors() { return $this->errors; } } try { throw new FunkyException ('test', ['this','that']); } catch (FunkyException $e) { print_r ($e->getErrors()); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
Found catch point at position: 6
Branch analysis from position: 6
2 jumps found. (Code = 107) Position 1 = 7, Position 2 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cgDKE
function name:  (null)
number of ops:  13
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   NEW                                              $1      'FunkyException'
          1        SEND_VAL_EX                                              'test'
          2        SEND_VAL_EX                                              <array>
          3        DO_FCALL                                      0          
          4      > THROW                                         0          $1
          5*       JMP                                                      ->12
   25     6  E > > CATCH                                       last         'FunkyException'
   27     7    >   INIT_FCALL                                               'print_r'
          8        INIT_METHOD_CALL                                         !0, 'getErrors'
          9        DO_FCALL                                      0  $3      
         10        SEND_VAR                                                 $3
         11        DO_ICALL                                                 
   28    12      > RETURN                                                   1

Class FunkyException:
Function __constructor:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cgDKE
function name:  __constructor
number of ops:  10
compiled vars:  !0 = $message, !1 = $errors
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    9     2        ASSIGN_OBJ                                               'message'
          3        OP_DATA                                                  !0
   10     4        ASSIGN_OBJ                                               'errors'
          5        OP_DATA                                                  !1
   12     6        INIT_STATIC_METHOD_CALL                                  
          7        SEND_VAR_EX                                              !0
          8        DO_FCALL                                      0          
   13     9      > RETURN                                                   null

End of function __constructor

Function geterrors:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cgDKE
function name:  getErrors
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   FETCH_OBJ_R                                      ~0      'errors'
          1      > RETURN                                                   ~0
   18     2*     > RETURN                                                   null

End of function geterrors

End of class FunkyException.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.64 ms | 1396 KiB | 15 Q