var_dump(object) 返回:object()#1
我真的很想知道 object()#1、object()#2 和 object()#3 之间有什么区别。
任何帮助表示赞赏。
对于具有相同信息(相同类、相同属性)的对象,它允许确定它们是否是相同的实例。例如:
$a = new DateTime();
$b = $a; // Link to same instance
$c = clone $a; // Create a new copy
var_dump($a, $b, $c);
object(DateTime)#1 (3) {
["date"]=>
string(26) "2020-08-15 19:23:39.016441"
["timezone_type"]=>
int(3)
["timezone"]=>
string(16) "Europe/Amsterdam"
}
object(DateTime)#1 (3) {
["date"]=>
string(26) "2020-08-15 19:23:39.016441"
["timezone_type"]=>
int(3)
["timezone"]=>
string(16) "Europe/Amsterdam"
}
object(DateTime)#2 (3) {
["date"]=>
string(26) "2020-08-15 19:23:39.016441"
["timezone_type"]=>
int(3)
["timezone"]=>
string(16) "Europe/Amsterdam"
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)