FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » object id - where?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: object id - where? [message #177906 is a reply to message #177904] Thu, 26 April 2012 09:42 Go to previous messageGo to previous message
M. Strobel is currently offline  M. Strobel
Messages: 386
Registered: December 2011
Karma:
Senior Member
Am 26.04.2012 11:38, schrieb Jerry Stuckle:
> On 4/26/2012 5:34 AM, M. Strobel wrote:
>> Hi,
>>
>> is there something like an object id accessible?
>>
>> Example: I do this
>>
>> php> $a = new stdclass;
>> php> $a->b = new stdclass;
>> php> var_dump($a);
>> object(stdClass)#1 (1) {
>> ["b"]=>
>> object(stdClass)#2 (0) {
>> }
>> }
>> php>
>>
>> and var_dump() shows me unique ids of the classes. Is there a function for it?
>>
>> /Str.
>
> Classes do not have id's. Objects have unique ids, but they are only for reference
> and can change.
>
> Why would you want such a function?
>

To detect loops in a tree. Just an idea.

I know I can give them an id, but only if it's necessary...

/Str.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Stats comp.lang.php (last 7 days)
Next Topic: Webhosting, Domain Name, Data Center Cyprus, Hosting Services
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu May 08 23:43:58 GMT 2025

Total time taken to generate the page: 0.04029 seconds