3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class CarPrototype { protected $doors; protected $wheels; abstract function __clone(); function getDoors() { return $this->doors; } function setDoors($doors) { $this->doors = $doors; } function __toString() { echo $this->doors . ' ' . $this->wheels; } } class NormalCarPrototype extends CarPrototype { function __construct() { $this->doors = 4; $this->wheels = 4; } function __clone() { } } $car = new NormalCarPrototype(); $sandero = clone $car; $duster = clone $car; echo $sandero;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/72JKM
function name:  (null)
number of ops:  11
compiled vars:  !0 = $car, !1 = $sandero, !2 = $duster
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'carprototype'
   22     1        DECLARE_CLASS                                            'normalcarprototype', 'carprototype'
   32     2        NEW                                              $3      'NormalCarPrototype'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $3
   34     5        CLONE                                            ~6      !0
          6        ASSIGN                                                   !1, ~6
   36     7        CLONE                                            ~8      !0
          8        ASSIGN                                                   !2, ~8
   37     9        ECHO                                                     !1
         10      > RETURN                                                   1

Class CarPrototype:
Function __clone:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/72JKM
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 getdoors:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/72JKM
function name:  getDoors
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   FETCH_OBJ_R                                      ~0      'doors'
          1      > RETURN                                                   ~0
   11     2*     > RETURN                                                   null

End of function getdoors

Function setdoors:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/72JKM
function name:  setDoors
number of ops:  4
compiled vars:  !0 = $doors
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
   14     1        ASSIGN_OBJ                                               'doors'
          2        OP_DATA                                                  !0
   15     3      > RETURN                                                   null

End of function setdoors

Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/72JKM
function name:  __toString
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   FETCH_OBJ_R                                      ~0      'doors'
          1        CONCAT                                           ~1      ~0, '+'
          2        FETCH_OBJ_R                                      ~2      'wheels'
          3        CONCAT                                           ~3      ~1, ~2
          4        ECHO                                                     ~3
   19     5        VERIFY_RETURN_TYPE                                       
          6      > RETURN                                                   null

End of function __tostring

End of class CarPrototype.

Class NormalCarPrototype:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/72JKM
function name:  __construct
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   ASSIGN_OBJ                                               'doors'
          1        OP_DATA                                                  4
   25     2        ASSIGN_OBJ                                               'wheels'
          3        OP_DATA                                                  4
   26     4      > 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/72JKM
function name:  __clone
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E > > RETURN                                                   null

End of function __clone

End of class NormalCarPrototype.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.47 ms | 1403 KiB | 13 Q