language/oop5/object-comparison.xml
a9edd62d087ab1eb6292c795b7256e14ff9f1234
...
...
@@ -5,7 +5,7 @@
5
5
<para>
6
6
When using the comparison operator (<literal>==</literal>),
7
7
object variables are compared in a simple manner, namely: Two object
8
-
instances are equal if they have the same attributes and values, and are
8
+
instances are equal if they have the same attributes and values (values are compared with <literal>==</literal>), and are
9
9
instances of the same class.
10
10
</para>
11
11
<para>
...
...
@@ -16,7 +16,7 @@
16
16
<para>
17
17
An example will clarify these rules.
18
18
<example>
19
-
<title>Example of object comparison in PHP 5</title>
19
+
<title>Example of object comparison</title>
20
20
<programlisting role="php">
21
21
<![CDATA[
22
22
<?php
...
...
@@ -41,7 +41,7 @@ class Flag
41
41
{
42
42
public $flag;
43
43

44
-
function Flag($flag = true) {
44
+
function __construct($flag = true) {
45
45
$this->flag = $flag;
46
46
}
47
47
}
...
...
@@ -50,7 +50,7 @@ class OtherFlag
50
50
{
51
51
public $flag;
52
52

53
-
function OtherFlag($flag = true) {
53
+
function __construct($flag = true) {
54
54
$this->flag = $flag;
55
55
}
56
56
}
...
...
@@ -102,7 +102,6 @@ o1 !== o2 : TRUE
102
102
</para>
103
103
</note>
104
104
</sect1>
105
-
106
105
<!-- Keep this comment at the end of the file
107
106
Local variables:
108
107
mode: sgml
109
108