php cloneのプログラム
<?php
class A{
public $name = “デモサイト";
}
$a = new A();
$b = $a;
$c = &$a;
$d = clone $a;
$a->name = “index";
echo “<pre>";
var_dump($a->name); //index
var_dump($b->name); //index
var_dump($c->name); //index
var_dump($d->name); //demo
$a = “demo";
$b = $a;
$a = “index";
$c = &$a;
echo $a . “<br/>"; //index
echo $b . “<br/>"; //demo
echo $c; //index
?>