Re: New function: spl_object_id() or spl_object_handle()
| From: | Patrick Schaaf | Date: | Fri, 28 Nov 2014 20:06:30 +0000 |
| Subject: | Re: New function: spl_object_id() or spl_object_handle() | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-79290@lists.php.net to get a copy of this message | ||
Am 28.11.2014 20:23 schrieb "Bostjan Skufca" <bostjan@a2o.si>:
>
> On 28 November 2014 at 04:10, reeze <reeze@php.net> wrote:
>
> > Won't
$obj1 === $obj2 work for you ?
> 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?
Why would you care about that?
You would need to stash away that "identity information" somewhere, in
bootstrap.php, and refer to that in view.phtml, right? Why can't you just
stash away the object itself? Then you won't even have a need to "receive
the object" in view.phtml.
I really don't get it. What are you trying to do there that you cannot do
with storing the object (reference) itself?
best regards
Patrick