3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private $library; public function test() { $this->library = 'library'; $selector = clone $this; $selector->library = 'test'; var_dump($selector); } } $a = new A; $a->test();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1VIm5
function name:  (null)
number of ops:  6
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   NEW                                              $1      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   17     3        INIT_METHOD_CALL                                         !0, 'test'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Class A:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1VIm5
function name:  test
number of ops:  11
compiled vars:  !0 = $selector
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN_OBJ                                               'library'
          1        OP_DATA                                                  'library'
    9     2        FETCH_THIS                                       ~2      
          3        CLONE                                            ~3      ~2
          4        ASSIGN                                                   !0, ~3
   11     5        ASSIGN_OBJ                                               !0, 'library'
          6        OP_DATA                                                  'test'
   12     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
   13    10      > RETURN                                                   null

End of function test

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.72 ms | 1395 KiB | 15 Q