Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #5742

Re: object id - where?

From "M. Strobel" <sorry_no_mail_here@nowhere.dee>
Newsgroups comp.lang.php
Subject Re: object id - where?
Date 2012-04-26 11:42 +0200
Message-ID <9vsjjgFj9mU2@mid.uni-berlin.de> (permalink)
References <9vsj4kFfumU1@mid.uni-berlin.de> <jnb52c$lg2$1@dont-email.me>

Show all headers | View raw


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.

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

object id - where? "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2012-04-26 11:34 +0200
  Re: object id - where? Jerry Stuckle <jstucklex@attglobal.net> - 2012-04-26 05:38 -0400
    Re: object id - where? "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2012-04-26 11:42 +0200
      Re: object id - where? Jerry Stuckle <jstucklex@attglobal.net> - 2012-04-26 20:33 -0400
  Re: object id - where? Thomas Mlynarczyk <thomas@mlynarczyk-webdesign.de> - 2012-04-27 22:07 +0200
  Re: object id - where? Goran <goran@nospam.com> - 2012-04-30 13:19 +0200
    Re: object id - where? "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2012-04-30 14:43 +0200

csiph-web