Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:21828 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 58091 invoked by uid 1010); 9 Feb 2006 22:05:40 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 58076 invoked from network); 9 Feb 2006 22:05:40 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Feb 2006 22:05:40 -0000 X-Host-Fingerprint: 69.60.120.90 iconoclast.caedmon.net Linux 2.4/2.6 Received: from ([69.60.120.90:46920] helo=iconoclast.caedmon.net) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 0A/FF-35443-4BCBBE34 for ; Thu, 09 Feb 2006 17:05:40 -0500 Received: from localhost ([127.0.0.1]) by iconoclast.caedmon.net with esmtp (Exim 3.35 #1 (Debian)) id 1F7Jtx-0006bg-00; Thu, 09 Feb 2006 17:04:33 -0500 Message-ID: <43EBBD74.8010703@caedmon.net> Date: Thu, 09 Feb 2006 17:08:52 -0500 User-Agent: Thunderbird 1.5 (Windows/20051201) MIME-Version: 1.0 To: "Ian P. Christian" CC: internals@lists.php.net References: <200602092154.01908.pookey@pookey.co.uk> In-Reply-To: <200602092154.01908.pookey@pookey.co.uk> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] 'odd' handling of $moo['bar'] where $moo is a string From: sean@caedmon.net (Sean Coates) > 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. It's cast to an integer. sean@iconoclast:~$ php -r 'echo (int) "file" . "\n";' 0 sean@iconoclast:~$ php -r 'echo (bool) "file" . "\n";' 1 S