$a = new Car();
$a->name = 'new car';
$b = clone $a;
if ($a == $b) echo '$a == $b'.'<br>'; //true
if ($a === $b) echo '$a === $b'.'<br>'; //false
$c = $a;
if($a == $c) echo '$a == $c'.'<br>';
if($a === $c) echo '$a === $c'.'<br>';
结果:
$a == $b
$a == $c
$a === $c
$a->name = 'new car';
$b = clone $a;
if ($a == $b) echo '$a == $b'.'<br>'; //true
if ($a === $b) echo '$a === $b'.'<br>'; //false
$c = $a;
if($a == $c) echo '$a == $c'.'<br>';
if($a === $c) echo '$a === $c'.'<br>';
结果:
$a == $b
$a == $c
$a === $c
2016-07-14
$p='/\w+\.(php|css|js)/';
$r='<em>$0</em>';
echo preg_replace($p,$r,$str);
$r='<em>$0</em>';
echo preg_replace($p,$r,$str);
2016-07-12