Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:42606 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 78645 invoked from network); 13 Jan 2009 15:44:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Jan 2009 15:44:32 -0000 Authentication-Results: pb1.pair.com smtp.mail=mark@dynom.nl; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=mark@dynom.nl; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain dynom.nl does not designate 85.92.132.6 as permitted sender) X-PHP-List-Original-Sender: mark@dynom.nl X-Host-Fingerprint: 85.92.132.6 smtp1.duximus.nl Linux 2.5 (sometimes 2.4) (4) Received: from [85.92.132.6] ([85.92.132.6:37831] helo=smtp1.duximus.nl) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 17/99-42308-ED6BC694 for ; Tue, 13 Jan 2009 10:44:32 -0500 Received: by smtp1.duximus.nl (Postfix, from userid 501) id 587E4B0264C; Tue, 13 Jan 2009 16:41:35 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.1.9 (2007-02-13) on dux03.duximus.nl X-Spam-Level: X-Spam-Status: No, score=-2.5 required=1.8 tests=AWL,BAYES_00 autolearn=ham version=3.1.9 Received: from localhost (dux03.duximus.nl [127.0.0.1]) by smtp1.duximus.nl (Postfix) with ESMTP id E86EBB0264C for ; Tue, 13 Jan 2009 16:41:34 +0100 (CET) X-Virus-Scanned: amavisd-new at duximus.nl Received: from smtp1.duximus.nl ([127.0.0.1]) by localhost (dux03.duximus.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 5OcFpH2DX1MD for ; Tue, 13 Jan 2009 16:41:29 +0100 (CET) Received: from dux05.duximus.nl (unknown [85.92.132.30]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp1.duximus.nl (Postfix) with ESMTP id 58D7DB0233E for ; Tue, 13 Jan 2009 16:41:29 +0100 (CET) Received: from localhost ([127.0.0.1] helo=[192.168.1.100]) by dux05.duximus.nl with esmtpa (Exim 4.60) (envelope-from ) id 1LMlVW-0006PT-0J for internals@lists.php.net; Tue, 13 Jan 2009 16:48:46 +0100 Message-ID: <496CB6BE.2000704@dynom.nl> Date: Tue, 13 Jan 2009 16:43:58 +0100 User-Agent: Thunderbird 2.0.0.19 (Windows/20081209) MIME-Version: 1.0 To: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: SPL ArrayAccess offsetExists default behavior From: mark@dynom.nl (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) check within offsetExists() that do not take return false on a NULL value, unlike isset(). What say you ? - Mark