Re: [PHP] Object ID



I suspect that's not an "absolute" ID, but just an ID for that
particular dump. So it has no applicability beyond that dump...

On Wed, February 14, 2007 11:31 am, Eli wrote:
Hi,

How can I get the object ID number of each Object in PHP (v.5.2) ?

The ID number is the one produced when dumping:
<?php
class A {}
class B {}
$a = new A();
$b = new B();
var_dump($a);
var_dump($b);
?>
=== output:
object(A)#1 (0) {
}
object(B)#2 (0) {
}

I do not want to buffer and parse the dumped string... Is there a
nicer way?

-thanks!

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
.



Relevant Pages

  • Re: HTML/PHP include files
    ... The interesting thing is even if I try a basic php command, ... or niether. ... see if its the problem by copying your includes dir to the jennifer dir and ... or use the absolute paths above(make sure to delete jennifer/includes so you ...
    (alt.html)
  • Re: [PHP] PHP 5.2.3 - Segmentation fault (core dumped)
    ... Anyway, I think it's exceptionally poor show by php to cause a segfault, ... nobody has ever been interested in looking at the core dump. ... Zbigniew has not actually managed to get Apache started with PHP installed so ...
    (php.general)
  • Re: mysql backup via php?
    ... >>Mosher wrote: ... find the dump and copy and paste it into the mysql db ... >>>script out there, preferably written in PHP? ...
    (comp.lang.php)
  • Re: [PHP] PHP 5.2.3 - Segmentation fault (core dumped)
    ... I have seen the apache core ... Anyway, I think it's exceptionally poor show by php to cause a segfault, ... nobody has ever been interested in looking at the core dump. ... Zbigniew has not actually managed to get Apache started with PHP installed so trying to debug stuff running in PHP is a little pointless. ...
    (php.general)
  • Re: HTML/PHP include files
    ... not sure if this is the problem but your two php files are different: ... see if its the problem by copying your includes dir to the jennifer dir and ... or use the absolute paths above(make sure to delete jennifer/includes so you ... I thought that I could include an html file from a php statement ...
    (alt.html)