3v4l.org

run code in 300+ PHP versions simultaneously
<?php class y { private $ppp = 123; } class x { public function __construct() { $x =& $this; $x = new y; var_dump(get_class($this)); $y = $this; var_dump($y->ppp); } } new x;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WB3rr
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $0      'x'
          1        DO_FCALL                                      0          
          2        FREE                                                     $0
          3      > RETURN                                                   1

Class y: [no user functions]
Class x:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WB3rr
function name:  __construct
number of ops:  17
compiled vars:  !0 = $x, !1 = $y
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   FETCH_THIS                                       $2      
          1        ASSIGN_REF                                               !0, $2
    8     2        NEW                                              $4      'y'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $4
    9     5        INIT_FCALL                                               'var_dump'
          6        FETCH_THIS                                       ~7      
          7        GET_CLASS                                        ~8      ~7
          8        SEND_VAL                                                 ~8
          9        DO_ICALL                                                 
   10    10        FETCH_THIS                                       ~10     
         11        ASSIGN                                                   !1, ~10
   11    12        INIT_FCALL                                               'var_dump'
         13        FETCH_OBJ_R                                      ~12     !1, 'ppp'
         14        SEND_VAL                                                 ~12
         15        DO_ICALL                                                 
   12    16      > RETURN                                                   null

End of function __construct

End of class x.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.8 ms | 1395 KiB | 15 Q