3v4l.org

run code in 500+ PHP versions simultaneously
<?php class x { function __construct(protected readonly int $x) { } } class y extends x { function __construct(protected readonly int $x) { parent::__construct($x); } } new y(1); // Fatal error: Uncaught Error: Cannot modify readonly property y::$x class z extends x { function __construct(int $x) { parent::__construct($x); } } new z(1); // OK ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RIZ8k
function name:  (null)
number of ops:  9
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   14     0  E >   NEW                                                  $0      'y'
          1        SEND_VAL_EX                                                  1
          2        DO_FCALL                                          0          
          3        FREE                                                         $0
   23     4        NEW                                                  $2      'z'
          5        SEND_VAL_EX                                                  1
          6        DO_FCALL                                          0          
          7        FREE                                                         $2
   26     8      > RETURN                                                       1

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

End of function __construct

End of class x.

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

End of function __construct

End of class y.

Class z:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RIZ8k
function name:  __construct
number of ops:  5
compiled vars:  !0 = $x
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   18     0  E >   RECV                                                 !0      
   19     1        INIT_STATIC_METHOD_CALL                                      
          2        SEND_VAR_EX                                                  !0
          3        DO_FCALL                                          0          
   20     4      > RETURN                                                       null

End of function __construct

End of class z.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
166.33 ms | 1484 KiB | 13 Q