Re: [PHP-DEV] SPL ArrayAccess offsetExists default behavior

2009-01-25 Thread Lukas Kahwe Smith
On 13.01.2009, at 16:58, Etienne Kneuss wrote: Hello, On Tue, Jan 13, 2009 at 4:43 PM, Mark van der Velden wrote: Hi list, The following doesn't strike me as consistent behavior: $a = new ArrayObject(); $a["foobar"] = NULL; echo (int) isset( $a["foobar"] ); // Output: 1 Whil

Re: [PHP-DEV] SPL ArrayAccess offsetExists default behavior

2009-01-13 Thread Etienne Kneuss
Hello, On Tue, Jan 13, 2009 at 4:43 PM, Mark van der Velden wrote: > Hi list, > > The following doesn't strike me as consistent behavior: > > $a = new ArrayObject(); > $a["foobar"] = NULL; > > echo (int) isset( $a["foobar"] ); // Output: 1 > > > While it's technically correct, I find it

[PHP-DEV] SPL ArrayAccess offsetExists default behavior

2009-01-13 Thread Mark van der Velden
Hi list, The following doesn't strike me as consistent behavior: $a = new ArrayObject(); $a["foobar"] = NULL; echo (int) isset( $a["foobar"] ); // Output: 1 While it's technically correct, I find it confusing. The reason is probably because of a array_key_exists (or property_exists