3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ExceptionX extends Exception{ public $code = "foo"; function __construct(){ $this->code = new stdclass; } } class ErrorX extends Error{ public $code = "foo"; function __construct(){ $this->code = new stdclass; } } $v = new ExceptionX(); var_dump($v->code); var_dump($v->getCode()); $v = new ErrorX(); var_dump($v->code); var_dump($v->getCode());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BoF4U
function name:  (null)
number of ops:  25
compiled vars:  !0 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   NEW                                              $1      'ExceptionX'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   18     3        INIT_FCALL                                               'var_dump'
          4        FETCH_OBJ_R                                      ~4      !0, 'code'
          5        SEND_VAL                                                 ~4
          6        DO_ICALL                                                 
   19     7        INIT_FCALL                                               'var_dump'
          8        INIT_METHOD_CALL                                         !0, 'getCode'
          9        DO_FCALL                                      0  $6      
         10        SEND_VAR                                                 $6
         11        DO_ICALL                                                 
   21    12        NEW                                              $8      'ErrorX'
         13        DO_FCALL                                      0          
         14        ASSIGN                                                   !0, $8
   22    15        INIT_FCALL                                               'var_dump'
         16        FETCH_OBJ_R                                      ~11     !0, 'code'
         17        SEND_VAL                                                 ~11
         18        DO_ICALL                                                 
   23    19        INIT_FCALL                                               'var_dump'
         20        INIT_METHOD_CALL                                         !0, 'getCode'
         21        DO_FCALL                                      0  $13     
         22        SEND_VAR                                                 $13
         23        DO_ICALL                                                 
         24      > RETURN                                                   1

Class ExceptionX:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BoF4U
function name:  __construct
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   NEW                                              $1      'stdclass'
          1        DO_FCALL                                      0          
          2        ASSIGN_OBJ                                               'code'
          3        OP_DATA                                                  $1
    7     4      > RETURN                                                   null

End of function __construct

End of class ExceptionX.

Class ErrorX:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BoF4U
function name:  __construct
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $1      'stdclass'
          1        DO_FCALL                                      0          
          2        ASSIGN_OBJ                                               'code'
          3        OP_DATA                                                  $1
   14     4      > RETURN                                                   null

End of function __construct

End of class ErrorX.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.91 ms | 1400 KiB | 15 Q