对象的比较 在 php 4 中,对象比较的规则十分简单:如果两个对象是同一个类的实例,且它们有相同的属性和值,则这两个对象相等。类似的规则还适用与用全等符(===)对两个对象的比较。 如果执行以下范例中的代码: 例子 18-1. php 4 中对象比较范例
有一些设计问题还是使用易变对象比较容易解决。
Some design problems are easier to solve with mutable objects.
在对象比较中,对象一致和对象相等分别是指什么?
In the context of a comparison, what is object identity versus object equivalence?
序列对象可以与相同类型的其它对象比较。
Sequence objects may be compared to other objects with the same sequence type.
OK, in each case, what these things are doing, is they're doing, what sometimes gets referred to as operator overloading.
这将会是个默认的或者说是,通用的来比较对象是否相同的方法,好,在每个例子中,这些事情正在做的,就是,一些与操作符重载有关的东西。
Second thing I want to look at is, suppose I compare that the one below it.
我要说的第二件事情是,假设我比较它下面的那个对象。
It's because these are the women who have abdominal obesity, so women are less likely to have it in the first place, but many do, and of those who do and have that metabolic syndrome, then they're more susceptible to the heart disease outcomes than men are.
这是因为研究对象都是有腹部肥胖的女性,女性一开始的确比较少患腹部肥胖,但其中仍有人会有腹部肥胖,所以那些患代谢综合征的腹部肥胖女性,与男性相比更容易受到心脏疾病的影响
应用推荐