3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $test = 'that'; public function bar() { $new = clone $this; $new->test = 'weird!'; } public function getTest() { return $this->test; } } $foo1 = new Foo; echo $foo1->getTest(); $foo2 = $foo1->bar(); echo $foo2->getTest();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aUUdJ
function name:  (null)
number of ops:  13
compiled vars:  !0 = $foo1, !1 = $foo2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $2      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   16     3        INIT_METHOD_CALL                                         !0, 'getTest'
          4        DO_FCALL                                      0  $5      
          5        ECHO                                                     $5
   17     6        INIT_METHOD_CALL                                         !0, 'bar'
          7        DO_FCALL                                      0  $6      
          8        ASSIGN                                                   !1, $6
   18     9        INIT_METHOD_CALL                                         !1, 'getTest'
         10        DO_FCALL                                      0  $8      
         11        ECHO                                                     $8
         12      > RETURN                                                   1

Class Foo:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aUUdJ
function name:  bar
number of ops:  6
compiled vars:  !0 = $new
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   FETCH_THIS                                       ~1      
          1        CLONE                                            ~2      ~1
          2        ASSIGN                                                   !0, ~2
    8     3        ASSIGN_OBJ                                               !0, 'test'
          4        OP_DATA                                                  'weird%21'
    9     5      > RETURN                                                   null

End of function bar

Function gettest:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aUUdJ
function name:  getTest
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   FETCH_OBJ_R                                      ~0      'test'
          1      > RETURN                                                   ~0
   13     2*     > RETURN                                                   null

End of function gettest

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.63 ms | 1394 KiB | 13 Q