1.2.1091. Set Clone Link¶
This command creates a link DEFINITION between a clone call, and its equivalent magic method. This command may not detect all possible link for the clone. It may be missing information about the nature of the clone object.
<?php
class x {
// Store an object
private $a;
function foo() {
// This clone is linked to the magic method below
return clone $this;
}
function __clone() {
$this->a = clone $this->a;
}
}
// This is not linked to any __clone method, by lack of information
clone $x;
?>
See also Object Cloning.
1.2.1091.1. Connex PHP features¶
1.2.1091.1.1. Specs¶
Short name |
Complete/SetCloneLink |
Rulesets |
|
Exakat since |
1.9.2 |
PHP Version |
All |
Severity |
Minor |
Time To Fix |
Quick (30 mins) |
Precision |
High |
Available in |