Object Trong PHP

Comparing objects:

When using the comparison operator (==), object variables are compared in a simple manner, namely: Two object instances are equal if they have the same attributes and values (values are compared with ==), and are instances of the same class.

When using the identity operator (===), object variables are identical if and only if they refer to the same instance of the same class.

$obj1 = new Test();
$obj2 = new $obj1;
var_dump($obj1 !== $obj2); // true

Trong trường hợp trên $obj2 là một instance of Test