3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyException extends \PDOException { public function __construct($message, $code, $previous) { parent::__construct($message, $code, $previous); $this->errorInfo = array('code', 'sqlstate'); } } $e = new MyException('bla', '123', new \Exception()); var_dump(array($e->getMessage(), $e->getCode(), $e->getPrevious(), $e->errorInfo));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1luKL
function name:  (null)
number of ops:  23
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $1      'MyException'
          1        SEND_VAL_EX                                              'bla'
          2        SEND_VAL_EX                                              '123'
          3        NEW                                              $2      'Exception'
          4        DO_FCALL                                      0          
          5        SEND_VAR_NO_REF_EX                                       $2
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !0, $1
   14     8        INIT_FCALL                                               'var_dump'
          9        INIT_METHOD_CALL                                         !0, 'getMessage'
         10        DO_FCALL                                      0  $6      
         11        INIT_ARRAY                                       ~7      $6
         12        INIT_METHOD_CALL                                         !0, 'getCode'
         13        DO_FCALL                                      0  $8      
         14        ADD_ARRAY_ELEMENT                                ~7      $8
         15        INIT_METHOD_CALL                                         !0, 'getPrevious'
         16        DO_FCALL                                      0  $9      
         17        ADD_ARRAY_ELEMENT                                ~7      $9
         18        FETCH_OBJ_R                                      ~10     !0, 'errorInfo'
         19        ADD_ARRAY_ELEMENT                                ~7      ~10
         20        SEND_VAL                                                 ~7
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

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

End of function __construct

End of class MyException.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.3 ms | 1396 KiB | 15 Q