3v4l.org

run code in 300+ PHP versions simultaneously
<?php class y { public $ppp = 123; } class x { public function __construct() { $x =& $this; $x = new y; var_dump(get_class($this)); var_dump($this->ppp); } } new x;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YG3SE
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     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/YG3SE
function name:  __construct
number of ops:  15
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   FETCH_THIS                                       $1      
          1        ASSIGN_REF                                               !0, $1
    8     2        NEW                                              $3      'y'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $3
    9     5        INIT_FCALL                                               'var_dump'
          6        FETCH_THIS                                       ~6      
          7        GET_CLASS                                        ~7      ~6
          8        SEND_VAL                                                 ~7
          9        DO_ICALL                                                 
   10    10        INIT_FCALL                                               'var_dump'
         11        FETCH_OBJ_R                                      ~9      'ppp'
         12        SEND_VAL                                                 ~9
         13        DO_ICALL                                                 
   11    14      > RETURN                                                   null

End of function __construct

End of class x.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.46 ms | 1386 KiB | 15 Q