Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:42649 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 52300 invoked from network); 15 Jan 2009 20:21:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Jan 2009 20:21:09 -0000 Authentication-Results: pb1.pair.com header.from=robert@typo3.org; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=robert@typo3.org; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain typo3.org from 217.72.131.73 cause and error) X-PHP-List-Original-Sender: robert@typo3.org X-Host-Fingerprint: 217.72.131.73 mail.elios.de Linux 2.6 Received: from [217.72.131.73] ([217.72.131.73:43059] helo=mail.elios.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 43/51-01962-4BA9F694 for ; Thu, 15 Jan 2009 15:21:09 -0500 Received: from [192.168.178.31] (p548CF422.dip.t-dialin.net [84.140.244.34]) by mail.elios.de (Postfix) with ESMTP id C84361FE8E7C; Thu, 15 Jan 2009 21:20:16 +0100 (CET) Cc: "PHP Developers Mailing List" Message-ID: <07C57A44-0E94-479A-B64B-7F7E9279A746@typo3.org> To: "Paul Biggar" In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v930.3) Date: Thu, 15 Jan 2009 21:21:04 +0100 References: X-Mailer: Apple Mail (2.930.3) Subject: Re: [PHP-DEV] Unexpected behavior of $this->$propertyName[...] From: robert@typo3.org (Robert Lemke) Hi Paul, Am 15.01.2009 um 20:35 schrieb Paul Biggar: > I suspect neither bug nor feature. I think you expect that > $this->$propertyName['bar'] > is the same as: > ($this->$propertyName)['bar'] > but in fact it is: > $this->($propertyName['bar']) > > So in your example, 'bar' is the string index 0 for "foo"[0], hence > 'f'. okay, I already suspected something like that but had already suppressed that $string[0] works equally as $string{0}. > It has been pointed out before that one should be able to index an > expression, but currently PHP can only index variables. Personally, it > seems like a bug, but I'm not sure whether or not there's consensus. IMO it feels like a bug, although I now understand the reasons. What was the reason again to deprecate curly brackets access in PHP6? It would make the situation clearer in the above example if square brackets would be deprecated instead ... Anyway, thank you for the clarification. Robert