3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A extends Exception { const DEFAULT_CODE = 404; public function __construct($message = '', $code = 0, $exception = NULL) { parent::__construct($message, static::DEFAULT_CODE, $exception); } } class B extends A { const DEFAULT_CODE = 504; } var_dump(new B);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/guZfk
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'var_dump'
          1        NEW                                              $0      'B'
          2        DO_FCALL                                      0          
          3        SEND_VAR                                                 $0
          4        DO_ICALL                                                 
          5      > RETURN                                                   1

Class A:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/guZfk
function name:  __construct
number of ops:  10
compiled vars:  !0 = $message, !1 = $code, !2 = $exception
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV_INIT                                        !0      ''
          1        RECV_INIT                                        !1      0
          2        RECV_INIT                                        !2      null
    7     3        INIT_STATIC_METHOD_CALL                                  
          4        SEND_VAR_EX                                              !0
          5        FETCH_CLASS_CONSTANT                             ~3      'DEFAULT_CODE'
          6        SEND_VAL_EX                                              ~3
          7        SEND_VAR_EX                                              !2
          8        DO_FCALL                                      0          
    8     9      > RETURN                                                   null

End of function __construct

End of class A.

Class B:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/guZfk
function name:  __construct
number of ops:  10
compiled vars:  !0 = $message, !1 = $code, !2 = $exception
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV_INIT                                        !0      ''
          1        RECV_INIT                                        !1      0
          2        RECV_INIT                                        !2      null
    7     3        INIT_STATIC_METHOD_CALL                                  
          4        SEND_VAR_EX                                              !0
          5        FETCH_CLASS_CONSTANT                             ~3      'DEFAULT_CODE'
          6        SEND_VAL_EX                                              ~3
          7        SEND_VAR_EX                                              !2
          8        DO_FCALL                                      0          
    8     9      > RETURN                                                   null

End of function __construct

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.38 ms | 1396 KiB | 15 Q