Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:21832 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 65292 invoked by uid 1010); 9 Feb 2006 22:26:18 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 65277 invoked from network); 9 Feb 2006 22:26:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Feb 2006 22:26:18 -0000 X-Host-Fingerprint: 66.11.173.122 unknown Received: from ([66.11.173.122:63700] helo=interjinn.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 32/F0-35443-981CBE34 for ; Thu, 09 Feb 2006 17:26:18 -0500 Received: from blobule.suds (blobule.suds [192.168.1.3]) by interjinn.com (Postfix) with ESMTP id 340DD11FB69; Thu, 9 Feb 2006 17:26:14 -0500 (EST) To: "Ian P. Christian" Cc: internals@lists.php.net, Sean Coates In-Reply-To: <200602092210.06390.pookey@pookey.co.uk> References: <200602092154.01908.pookey@pookey.co.uk> <43EBBD74.8010703@caedmon.net> <200602092210.06390.pookey@pookey.co.uk> Content-Type: text/plain Organization: InterJinn Message-ID: <1139524120.2072.42.camel@blobule.suds> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5-4mdk Date: Thu, 09 Feb 2006 17:28:40 -0500 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] 'odd' handling of $moo['bar'] where $moo is a string From: robert@interjinn.com (Robert Cummings) On Thu, 2006-02-09 at 17:10, Ian P. Christian wrote: > On Thursday 09 February 2006 22:08, Sean Coates wrote: > > It's cast to an integer. > > Ahh.. I see. That does make sense now as to why it results in the first char > in the array - however I still think it makes more sense not to cast, but > rather to give a fatal error. PHP is primarily a web language. Many indexes are pulled from $_GET and $_POST and for obvious reasons are strings. One of the convenience factors of PHP is that noobs don't need to think about casting their strings to ints to index. Cheers, Rob. -- .------------------------------------------------------------. | InterJinn Application Framework - http://www.interjinn.com | :------------------------------------------------------------: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `------------------------------------------------------------'