3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $foo = 1; public function getFoo() { return $this->foo; } } Class Bar { public $foo; public function __construct() { $this->foo = new Foo(); } public function getOriginalFoo() { return clone $this->foo->getFoo(); } } $bar = new Bar(); var_dump($bar->getOriginalFoo());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LWbGg
function name:  (null)
number of ops:  9
compiled vars:  !0 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   NEW                                              $1      'Bar'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   30     3        INIT_FCALL                                               'var_dump'
          4        INIT_METHOD_CALL                                         !0, 'getOriginalFoo'
          5        DO_FCALL                                      0  $4      
          6        SEND_VAR                                                 $4
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Class Foo:
Function getfoo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LWbGg
function name:  getFoo
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   FETCH_OBJ_R                                      ~0      'foo'
          1      > RETURN                                                   ~0
   10     2*     > RETURN                                                   null

End of function getfoo

End of class Foo.

Class Bar:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LWbGg
function name:  __construct
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN_OBJ                                               'foo'
          3        OP_DATA                                                  $1
   20     4      > RETURN                                                   null

End of function __construct

Function getoriginalfoo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LWbGg
function name:  getOriginalFoo
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   FETCH_OBJ_R                                      ~0      'foo'
          1        INIT_METHOD_CALL                                         ~0, 'getFoo'
          2        DO_FCALL                                      0  $1      
          3        CLONE                                            ~2      $1
          4      > RETURN                                                   ~2
   25     5*     > RETURN                                                   null

End of function getoriginalfoo

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.55 ms | 1396 KiB | 15 Q