class public var class public var new a- var null new var_dump var_dum

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?
class z {
public $var = 1;
}
class y {
public $var = 2;
}
$a = new z();
$b =& $a;
$c = $a;
$a->var = null;
$b = new y();
var_dump($a);
var_dump($b);
var_dump($c);
/*
object(y)#2 (1) { ["var"]=> int(2) }
object(y)#2 (1) { ["var"]=> int(2) }
object(z)#1 (1) { ["var"]=> NULL }
*/
?>