Fix for bug #28325

php.internals

Moriyoshi Koizumi

22 years ago
I made a patch for bug #28325. I'd like to see this one applied by the time PHP5 gets out of the door. http://www.voltex.jp/patches/bug28325-preliminary.patch.diff Regards, Moriyoshi

Andi Gutmans

22 years ago
Hi Moriyoshi, The object handle is not a unique identifier. Different object types (e.g. PHP objects, SimpleXML objects) can have the same object handle. The real unique identifier is object handle + object handlers array or more useful in your case, possibly class name and object handle. Andi At 12:06 PM 6/30/2004 +0900, Moriyoshi Koizumi wrote:

Moriyoshi Koizumi

22 years ago
On 2004/07/01, at 14:25, Andi Gutmans wrote:
> Hi Moriyoshi, > > The object handle is not a unique identifier. Different object types > (e.g. PHP objects, SimpleXML objects) can have the same object handle. > The real unique identifier is object handle + object handlers array or > more useful in your case, possibly class name and object handle.
Thanks for the advice. So, will object handle + the VM address to the class entry suffice either? Moriyoshi

Sterling Hughes

22 years ago
this would still not suffice for a proper serialization, overloaded objects should have serialize and unserialize handlers.... something for 5.1 methinks. -sterling On Thu, 1 Jul 2004 16:03:09 +0900, Moriyoshi Koizumi <moriyoshi@at.wakwak.com> wrote:

Marcus Börger

22 years ago
Hello Sterling, i have that on my personal 5.1 todo list since months... marcus Thursday, July 1, 2004, 6:29:53 PM, you wrote:
> this would still not suffice for a proper serialization, overloaded > objects should have serialize and unserialize handlers.... something > for 5.1 methinks.
> -sterling
> On Thu, 1 Jul 2004 16:03:09 +0900, Moriyoshi Koizumi > <moriyoshi@at.wakwak.com> wrote: >> >> >> On 2004/07/01, at 14:25, Andi Gutmans wrote: >> >> > Hi Moriyoshi, >> > >> > The object handle is not a unique identifier. Different object types >> > (e.g. PHP objects, SimpleXML objects) can have the same object handle. >> > The real unique identifier is object handle + object handlers array or >> > more useful in your case, possibly class name and object handle. >> >> Thanks for the advice. So, will object handle + the VM address to the >> class entry suffice either? >> >> >> >> Moriyoshi >> >> -- >> PHP Internals - PHP Runtime Development Mailing List >> To unsubscribe, visit: http://www.php.net/unsub.php >> >>
-- Best regards, Marcus mailto:helly@php.net

Andi Gutmans

22 years ago
Yeah it might make sense to think of something like that. What does serializing a SimpleXML object do today? Andi At 09:29 AM 7/1/2004 -0700, Sterling Hughes wrote:

Moriyoshi Koizumi

22 years ago
This is the new one. Hope it is ready to commit this time. http://www.voltex.jp/patches/bug28325-preliminary-20040701.patch.diff Two untidy bitshifts are intended to form an atomic bit rotation and are somewhat necessary for the uniqueness of the hash value. At least 31 object handles of the same class can rarely be recognised wrongly with this code as long as blk (or mmap) call is sane and it properly maps the physical memory to the VM space. Moriyoshi On 2004/07/01, at 16:03, Moriyoshi Koizumi wrote:

Sebastian Bergmann

22 years ago
Andi Gutmans wrote:
> The object handle is not a unique identifier.
Are there any plans on implementing a really unique identifier to objects? This would, among other things, allow objects to be used as array keys.
-- Sebastian Bergmann http://sebastian-bergmann.de/ http://phpOpenTracker.de/ Das Buch zu PHP 5: http://professionelle-softwareentwicklung-mit-php5.de/