3v4l.org

run code in 500+ PHP versions simultaneously
<?php class a { private function __clone() { } private function __construct() { } public static function getInstance() { return new static(); } public function cloneIt() { $a = clone $this; return $a; } } class c extends a { } // private constructor $d = c::getInstance(); // private clone $e = $d->cloneIt();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bWr72
function name:  (null)
number of ops:  7
compiled vars:  !0 = $d, !1 = $e
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   32     0  E >   INIT_STATIC_METHOD_CALL                                      'c', 'getInstance'
          1        DO_FCALL                                          0  $2      
          2        ASSIGN                                                       !0, $2
   35     3        INIT_METHOD_CALL                                             !0, 'cloneIt'
          4        DO_FCALL                                          0  $4      
          5        ASSIGN                                                       !1, $4
          6      > RETURN                                                       1

Class a:
Function __clone:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bWr72
function name:  __clone
number of ops:  1
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E > > RETURN                                                       null

End of function __clone

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

End of function __construct

Function getinstance:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bWr72
function name:  getInstance
number of ops:  4
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   16     0  E >   NEW                              static              $0      
          1        DO_FCALL                                          0          
          2      > RETURN                                                       $0
   17     3*     > RETURN                                                       null

End of function getinstance

Function cloneit:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bWr72
function name:  cloneIt
number of ops:  5
compiled vars:  !0 = $a
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   21     0  E >   FETCH_THIS                                           ~1      
          1        CLONE                                                ~2      ~1
          2        ASSIGN                                                       !0, ~2
   23     3      > RETURN                                                       !0
   24     4*     > RETURN                                                       null

End of function cloneit

End of class a.

Class c:
Function __clone:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bWr72
function name:  __clone
number of ops:  1
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E > > RETURN                                                       null

End of function __clone

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

End of function __construct

Function getinstance:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bWr72
function name:  getInstance
number of ops:  4
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   16     0  E >   NEW                              static              $0      
          1        DO_FCALL                                          0          
          2      > RETURN                                                       $0
   17     3*     > RETURN                                                       null

End of function getinstance

Function cloneit:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bWr72
function name:  cloneIt
number of ops:  5
compiled vars:  !0 = $a
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   21     0  E >   FETCH_THIS                                           ~1      
          1        CLONE                                                ~2      ~1
          2        ASSIGN                                                       !0, ~2
   23     3      > RETURN                                                       !0
   24     4*     > RETURN                                                       null

End of function cloneit

End of class c.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
159.06 ms | 2301 KiB | 14 Q