3v4l.org

run code in 300+ PHP versions simultaneously
<?php // lint >= 8.1 declare(strict_types = 1); namespace Bug11495; class HelloWorld { private readonly string $foo; public function __construct() { $this->foo = 'bar'; } public function __clone() { $this->foo = 'baz'; $this->foo = 'baz'; } public function getFoo(): string { return $this->foo; } } $f = new HelloWorld(); $c = clone $f;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oaLm9
function name:  (null)
number of ops:  6
compiled vars:  !0 = $f, !1 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   NEW                                              $2      'Bug11495%5CHelloWorld'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   28     3        CLONE                                            ~5      !0
          4        ASSIGN                                                   !1, ~5
   29     5      > RETURN                                                   1

Class Bug11495\HelloWorld:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oaLm9
function name:  __construct
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ASSIGN_OBJ                                               'foo'
          1        OP_DATA                                                  'bar'
   13     2      > RETURN                                                   null

End of function __construct

Function __clone:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oaLm9
function name:  __clone
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   ASSIGN_OBJ                                               'foo'
          1        OP_DATA                                                  'baz'
   18     2        ASSIGN_OBJ                                               'foo'
          3        OP_DATA                                                  'baz'
   19     4      > RETURN                                                   null

End of function __clone

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

End of function getfoo

End of class Bug11495\HelloWorld.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.14 ms | 996 KiB | 13 Q