i am learning about OOP and classes and all that fun stuff
i know that with __construct() i can put a Variable i the parentheses as input and use it.
but it doesn't seem to work with __clone() or __destruct()
here's my code and me trying to put something in.
Code: Select all
<?
CLASS a{
public $A=5;
public $B=29;
public $C=12;
FUNCTION __construct(){
echo"i'm the original<br>";
echo $this->A . "<br>";
echo $this->B . "<br>";
echo $this->C . "<br>";
}
public FUNCTION __CLONE($data){
$data++;
echo $data;
$totul=$this->A+$this->B/$this->C . "<br>";
echo"i'm a clone of class a<br>";
echo $totul;
}
FUNCTION __destruct(){
$total=$this->A*$this->B*$this->C . "<br>";
echo $total;
echo"CLASS a closing down<br>";
}
}
$a= new a();
?>
<h1 align="center>YOOHOO!</h1>
<?
$b= clone(1)$a;
?>Fatal error: Method a::__clone() cannot accept any arguments in C:\.........\OBJ_base.php on line 18
If there is something i'm over looking let me know or if it's just a matter of looking. i tried the web couldn't see much.
any suggestions? is it possible to do what i am trying to do?
Anyways thanks
Oliver