Re: [PHP-DEV] New function proposal: spl_object_id

2009-01-25 Thread Lukas Kahwe Smith
On 24.01.2009, at 19:19, Guilherme Blanco wrote: Hi Oskar, Yes, you can use a plain array too. I was just giving you a normal approach (ArrayAccess inherited class) because you may want a special behavior under it too. Forget SplObjectStorage docs they're outdated read the source!

Re: [PHP-DEV] New function proposal: spl_object_id

2009-01-25 Thread Etienne Kneuss
Hello, On Sun, Jan 25, 2009 at 4:24 PM, Lukas Kahwe Smith m...@pooteeweet.org wrote: On 24.01.2009, at 19:19, Guilherme Blanco wrote: Hi Oskar, Yes, you can use a plain array too. I was just giving you a normal approach (ArrayAccess inherited class) because you may want a special behavior

Re: [PHP-DEV] New function proposal: spl_object_id

2009-01-24 Thread Oskar Eisemuth
Hello Guilherme The new implementation of spl_object_hash will solve it, since it's a faster implementation than the old one. Just one hint, you should not try to echo the generated hash, since it may have non-printable chars. I don't think that will be a problem... Also, your code may

Re: [PHP-DEV] New function proposal: spl_object_id

2009-01-24 Thread Guilherme Blanco
Hi Oskar, Yes, you can use a plain array too. I was just giving you a normal approach (ArrayAccess inherited class) because you may want a special behavior under it too. Forget SplObjectStorage docs they're outdated read the source! =) Undoubtely devs will not mark spl_object_hash a

Re: [PHP-DEV] New function proposal: spl_object_id

2009-01-23 Thread Oskar Eisemuth
Hello My usage for spl_object_id wouldn't be solved with SplObjectStorage, here is my current event handler (it uses spl_object_hash) I still have the plan to replace it with something better but it simply works, currently it's not possible to free an object. EVENT::register accepts a static

Re: [PHP-DEV] New function proposal: spl_object_id

2009-01-22 Thread Etienne Kneuss
Hello, On Tue, Jan 20, 2009 at 2:38 PM, Etienne Kneuss webmas...@colder.ch wrote: Hello, On Tue, Jan 20, 2009 at 2:23 PM, Guilherme Blanco guilhermebla...@gmail.com wrote: Etienne, We all already considered to not implement spl_object_id as long as spl_object_hash is optimized. Ok then,

Re: [PHP-DEV] New function proposal: spl_object_id

2009-01-20 Thread Etienne Kneuss
Hello, We already had that discussion in private, but here is a on-list summary: On Mon, Jan 19, 2009 at 5:39 PM, Guilherme Blanco guilhermebla...@gmail.com wrote: Ok, We'll use this method inside Doctrine ORM version 2.0, scheduled to be released on September 1st, 2009. One main location

Re: [PHP-DEV] New function proposal: spl_object_id

2009-01-20 Thread Stan Vassilev | FM
Hi, I had a talk with Marcus, and he has agreed on this proposed solution: 1) SPL generates a pseudo-random session id/mask (for the current request, do not confuse with $_SESSION), which consists of 32 random bytes/characters. 2) The object is and the handler pointer are used to create a

Re: [PHP-DEV] New function proposal: spl_object_id

2009-01-20 Thread Etienne Kneuss
Hello, On Tue, Jan 20, 2009 at 11:47 AM, Stan Vassilev | FM sv_for...@fmethod.com wrote: Hi, I had a talk with Marcus, and he has agreed on this proposed solution: 1) SPL generates a pseudo-random session id/mask (for the current request, do not confuse with $_SESSION), which consists of

Re: [PHP-DEV] New function proposal: spl_object_id

2009-01-20 Thread Hannes Magnusson
On Tue, Jan 20, 2009 at 13:26, Etienne Kneuss webmas...@colder.ch wrote: Could you please provide an example, with code, in which this function would be necessary ? (i.e. where you can't use SplObjeccctStorage) Why? As far as i understand, the issue is that spl_object_hash() is slow and

Re: [PHP-DEV] New function proposal: spl_object_id

2009-01-20 Thread Etienne Kneuss
Hello, On Tue, Jan 20, 2009 at 1:45 PM, Guilherme Blanco guilhermebla...@gmail.com wrote: Hi, It seems SplObjectStorage will solve my issue. We already spoke on pvt about how to handle things correctly too. Although this solve my issue, the point that Stan highlighted is valid. You may not

Re: [PHP-DEV] New function proposal: spl_object_id

2009-01-20 Thread Guilherme Blanco
Etienne, We all already considered to not implement spl_object_id as long as spl_object_hash is optimized. Regards, On Tue, Jan 20, 2009 at 11:20 AM, Etienne Kneuss webmas...@colder.ch wrote: Hello, On Tue, Jan 20, 2009 at 1:41 PM, Hannes Magnusson hannes.magnus...@gmail.com wrote: On Tue,

Re: [PHP-DEV] New function proposal: spl_object_id

2009-01-20 Thread Etienne Kneuss
Hello, On Tue, Jan 20, 2009 at 2:23 PM, Guilherme Blanco guilhermebla...@gmail.com wrote: Etienne, We all already considered to not implement spl_object_id as long as spl_object_hash is optimized. Ok then, I'll provide a patch to improve spl_object_hash's performance, which will also change

[PHP-DEV] New function proposal: spl_object_id

2008-12-17 Thread Guilherme Blanco
Hi, I spoke with some devs yesterday about spl_object_hash performance and alternatives to solve it. Seems that md5 applied inside it is the responsable for that. After some tips from Lars, we came with a patch (at the bottom of this email). The new proposed function is already being used in

RE: [PHP-DEV] New function proposal: spl_object_id

2008-12-17 Thread Andi Gutmans
Shouldn't you be using RETURN_STRINGL with length and dup=0? Andi -Original Message- From: Guilherme Blanco [mailto:guilhermebla...@gmail.com] Sent: Wednesday, December 17, 2008 9:31 AM To: internals Mailing List Subject: [PHP-DEV] New function proposal: spl_object_id Hi, I

Re: [PHP-DEV] New function proposal: spl_object_id

2008-12-17 Thread Etienne Kneuss
Hello, On Wed, Dec 17, 2008 at 7:29 PM, Lars Strojny l...@strojny.net wrote: Hi Guilherme, thanks for moving the discussion to the list. Am Mittwoch, den 17.12.2008, 15:31 -0200 schrieb Guilherme Blanco: [...] It seems that Marcus controls the commit access to SPL. So I'm turning the

Re: [PHP-DEV] New function proposal: spl_object_id

2008-12-17 Thread Lars Strojny
Hi Andi, Am Mittwoch, den 17.12.2008, 10:33 -0800 schrieb Andi Gutmans: Shouldn't you be using RETURN_STRINGL with length and dup=0? Yes, the more recent implementation does exactly that :) cu, Lars signature.asc Description: Dies ist ein digital signierter Nachrichtenteil

Re: [PHP-DEV] New function proposal: spl_object_id

2008-12-17 Thread Lars Strojny
Hi Guilherme, thanks for moving the discussion to the list. Am Mittwoch, den 17.12.2008, 15:31 -0200 schrieb Guilherme Blanco: [...] It seems that Marcus controls the commit access to SPL. So I'm turning the conversation async, since I cannot find him online at IRC. So, can anyone review the

Re: [PHP-DEV] New function proposal: spl_object_id

2008-12-17 Thread Marcus Boerger
Hello Etienne, Wednesday, December 17, 2008, 7:59:01 PM, you wrote: Hello, On Wed, Dec 17, 2008 at 7:29 PM, Lars Strojny l...@strojny.net wrote: Hi Guilherme, thanks for moving the discussion to the list. Am Mittwoch, den 17.12.2008, 15:31 -0200 schrieb Guilherme Blanco: [...] It seems