On 28 November 2014 at 04:10, reeze <re...@php.net> wrote:

> Won't   `$obj1 === $obj2` work for you ?
>

This works if you have two objects which are easily accessible in the same
scope.

Not that it can not be done this way, but it may require jumping through
hoops to get two object references into the common scope where you can
compare them.

By having a method to retrieve and display object id/handle, one can easily
compare identity of objects in various scopes, and/or at various execution
times/points.

Think of it like this:
- in file bootstrap.php I see this object initialized and passed somewhere
- in file view.phtml I receive the object of the same type, but how can I
be sure that this object was not re-initialized somewhere in between?

b.

Reply via email to