3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { function muta($bar) { $new = &$this; $new = $bar; } } $a = new foo; $a->muta(new stdClass); echo get_class($foo);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VPNWr
function name:  (null)
number of ops:  11
compiled vars:  !0 = $a, !1 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   NEW                                              $2      'foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   14     3        INIT_METHOD_CALL                                         !0, 'muta'
          4        NEW                                              $5      'stdClass'
          5        DO_FCALL                                      0          
          6        SEND_VAR_NO_REF_EX                                       $5
          7        DO_FCALL                                      0          
   17     8        GET_CLASS                                        ~8      !1
          9        ECHO                                                     ~8
         10      > RETURN                                                   1

Class foo:
Function muta:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VPNWr
function name:  muta
number of ops:  5
compiled vars:  !0 = $bar, !1 = $new
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        FETCH_THIS                                       $2      
          2        ASSIGN_REF                                               !1, $2
    7     3        ASSIGN                                                   !1, !0
    8     4      > RETURN                                                   null

End of function muta

End of class foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.94 ms | 1393 KiB | 13 Q