Can I set a variable to be a pointer/reference to a class?
I'm not so good with pointer syntax, is it &?PHP Code:<?php
class Data {}
$DataClass = Data;
$Data1 = new $DataClass;
?>
Also, it's for something like this.
PHP Code:<?php
class A
{
public $B;
function __construct()
{
$this->B = &A_B;
}
}
class A_B
{
}
$A = new A();
$B = new $A->B();
?>




Reply With Quote