Page 1 of 1

How to indentify an object? ( Like hashcode() in java )

Posted: Mon Aug 07, 2006 3:04 pm
by ZeroFear
Is there something in PHP you can call on an object that will let you identifiy that specific object, like the default hashcode method in java?

Posted: Mon Aug 07, 2006 3:05 pm
by Luke
you can print it:

Code: Select all

print($obj)
And it will print Object Id #12 or whatever, but this may not always be supported.

Posted: Mon Aug 07, 2006 3:47 pm
by Weirdan
why would you need that in PHP?

Posted: Mon Aug 07, 2006 3:50 pm
by feyd
Weirdan wrote:why would you need that in PHP?
That's what I want to know.

Posted: Mon Aug 07, 2006 3:51 pm
by Christopher
There are functions/classes here:

http://www.php.net/manual/en/ref.classobj.php

http://us2.php.net/manual/en/language.o ... ection.php (why don't the put this section in the main manual !?%#*&)