Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:21827 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 53968 invoked by uid 1010); 9 Feb 2006 21:54:12 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 53953 invoked from network); 9 Feb 2006 21:54:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Feb 2006 21:54:12 -0000 X-Host-Fingerprint: 80.249.110.212 xian.ncuk.net Linux 2.5 (sometimes 2.4) (4) Received: from ([80.249.110.212:33694] helo=xian.ncuk.net) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id C6/8F-35443-40ABBE34 for ; Thu, 09 Feb 2006 16:54:12 -0500 To: internals@lists.php.net Date: Thu, 9 Feb 2006 21:54:01 +0000 User-Agent: KMail/1.9.1 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-ID: <200602092154.01908.pookey@pookey.co.uk> Subject: 'odd' handling of $moo['bar'] where $moo is a string From: pookey@pookey.co.uk ("Ian P. Christian") Can someone explain the following to me? echo "DEBUG:\n"; var_dump($keys); var_dump($keys['file']); var_dump(isset($keys['NOTEXISTING'])); var_dump(isset($keys['file'])); exit; DEBUG: string(19) "myConsoleController" string(1) "m" bool(true) bool(true) Now, it seems that $keys['file'] == $keys[0], which makes sense why the issets return true. However... if ('file') echo 'true'; will print moo, therefore 'file' == 1, not 0. Why is this different when using it as a string offset? IMO, using a string as a string offset, a fatal error should be raised. Kind Regards, -- Ian P. Christian http://pookey.co.uk