3v4l.org

run code in 300+ PHP versions simultaneously
<?php class a { function overWrite() { $tmp = &$this; $tmp = new b; } } class b { } $a = new a; $a->overWrite(); var_dump($a);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/m4VqH
function name:  (null)
number of ops:  9
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $1      'a'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   16     3        INIT_METHOD_CALL                                         !0, 'overWrite'
          4        DO_FCALL                                      0          
   17     5        INIT_FCALL                                               'var_dump'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Class a:
Function overwrite:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/m4VqH
function name:  overWrite
number of ops:  6
compiled vars:  !0 = $tmp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   FETCH_THIS                                       $1      
          1        ASSIGN_REF                                               !0, $1
    7     2        NEW                                              $3      'b'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $3
    8     5      > RETURN                                                   null

End of function overwrite

End of class a.

Class b: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.06 ms | 940 KiB | 16 Q