3v4l.org

run code in 500+ PHP versions simultaneously
<?php class X { readonly public string $property; public function __construct() { $this->property = 1; } } $object = new x(); $reference =& $object->property; //Cannot modify readonly property X::$property class Y { readonly public string $property; public function __construct(&$a) { // first time assignation $this->property = &$a; //Cannot modify readonly property X::$property } } $a = 'A'; $object = new Y($a);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jNtaT
function name:  (null)
number of ops:  11
compiled vars:  !0 = $object, !1 = $reference, !2 = $a
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     0  E >   NEW                                                  $3      'x'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $3
   12     3        FETCH_OBJ_W                                          $6      !0, 'property'
          4        ASSIGN_REF                                                   !1, $6
   25     5        ASSIGN                                                       !2, 'A'
   26     6        NEW                                                  $9      'Y'
          7        SEND_VAR_EX                                                  !2
          8        DO_FCALL                                          0          
          9        ASSIGN                                                       !0, $9
         10      > RETURN                                                       1

Class X:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jNtaT
function name:  __construct
number of ops:  3
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   ASSIGN_OBJ                                                   'property'
          1        OP_DATA                                                      1
    8     2      > 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/jNtaT
function name:  __construct
number of ops:  4
compiled vars:  !0 = $a
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   18     0  E >   RECV                                                 !0      
   20     1        ASSIGN_OBJ_REF                                               'property'
          2        OP_DATA                                                      !0
   22     3      > RETURN                                                       null

End of function __construct

End of class Y.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
164.89 ms | 1480 KiB | 13 Q