Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:13365 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 31644 invoked by uid 1010); 17 Oct 2004 16:28:50 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 31589 invoked from network); 17 Oct 2004 16:28:50 -0000 Received: from unknown (HELO sunshine.home) (80.108.136.197) by pb1.pair.com with SMTP; 17 Oct 2004 16:28:50 -0000 Received: from venom.home ([192.168.1.10]) by sunshine.home with asmtp (Exim 4.34) id 1CJDto-0002YK-V8 for internals@lists.php.net; Sun, 17 Oct 2004 18:28:49 +0200 Message-ID: <41729EE0.3060701@fischer.name> Date: Sun, 17 Oct 2004 18:33:36 +0200 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7) Gecko/20040514 MultiZilla/1.6.4.0a X-Accept-Language: en-us, en MIME-Version: 1.0 To: internals@lists.php.net References: <4172843B.9040300@ailis.de> In-Reply-To: <4172843B.9040300@ailis.de> X-Enigmail-Version: 0.84.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0 X-Spam-Level: / X-Spam-Report: Spam detection software, running on the system "sunshine.home", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or block similar future email. If you have any questions, see the administrator of that system for details. Content preview: Klaus Reimer wrote: > I've just seen that finally it's possible to do > "$object->getOtherObject()->doSomething()" with PHP5 which was not > possible in PHP4. But I wonder why something like this still does not work: > > $object->returnArray()[$index] > returnArray()[$index] > array(1,2,3,4)[$index] > > It would be really cool if a future version of PHP understands the above > syntax because currently it's really annoying to access an array element > returned from a method/function because the return value must be stored > in a temporary variable before it is possible to access elements from > that array. [...] Content analysis details: (0.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- Subject: Re: [PHP-DEV] array(...)[] From: markus@fischer.name (Markus Fischer) Klaus Reimer wrote: > I've just seen that finally it's possible to do > "$object->getOtherObject()->doSomething()" with PHP5 which was not > possible in PHP4. But I wonder why something like this still does not work: > > $object->returnArray()[$index] > returnArray()[$index] > array(1,2,3,4)[$index] > > It would be really cool if a future version of PHP understands the above > syntax because currently it's really annoying to access an array element > returned from a method/function because the return value must be stored > in a temporary variable before it is possible to access elements from > that array. I'm seconding this strongly. One of the most useful enhancements for meare, as you mention, $object->getOtherObject()->doSomething(), and the foreach ($a as $b => &c) syntax. Direct array referencing would be #3 for me [besides all the suport oo features] ;) - Markus