What is this concept called in programming? Particularly the bit in the constructor. I’d like to have a term to google.
<?PHP
class Foo{
private $bar;
function __construct(){
**$a = new Foo();
$a->setBar("Do I ever get printed?");
$this = $a;**
}
function setBar($a){
$this->bar = $a;
}
function getBar(){
return $this->bar
}
}
?>
<?PHP
$z = new Foo();
echo $z->getBar();
?>
“Infinite recursion”.