ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> php-dev
php-dev
Re: [PHP-DEV] Regarding constructions like func()[0]
by Melfar other posts by this author
Nov 7 2009 3:30PM messages near this date
Re: [PHP-DEV] Regarding constructions like func()[0] | Re: [PHP-DEV] Regarding constructions like func()[0]
Hey,

Yep, I think there might be some caveats to that change.
The original patch did not work on methods, so I've fixed that and also
made the return value an rvalue, so that you can't attempt to modify the
temporary value, the zend_check_writable_variable guard will yield an error.

The updated patch can be found at http://bugs.php.net/bug.php?id=50003

I've also heard an opinion that adding this construction is just going to 
make things more
complicated, but take this: chained ->  operators are supported for return
values and I'm only seeing code getting simpler because of that.

Br,
-melfar

"mm w" <0xcafefeed@[...].com>  wrote:

>  Hi Melfar, from my point of view I am totally to make this a legal
>  call like in python or ruby java,
>  as I liked compact code I liked to avoid temp vars especially on a
>  read-only call, but it might require some effort there and the final
>  patch might be not so simple, anyway this is a community call, what I
>  can say about this kind of missing feature "sometimes, I can hear in
>  my office" : "PHP is a retarded language, PHP sucks or worst", my
>  point there, that is sometimes good to listen to people who are not
>  "passionate" by the language but just using it to do their job and be
>  paid.
> 
>  Cheers!
> 
>  On Sat, Nov 7, 2009 at 3:42 AM, melfar <melfar@[...].com> wrote:
> > Hello!
> >
> > I have filed a bug (suggestion) at http://bugs.php.net/bug.php?id=50003
> > What do you think about enabling such a constructions in future versions 
> > of
> > php?
> >
> > Br,
> > -melfar
> >
> >
> >
> > --
> > PHP Internals - PHP Runtime Development Mailing List
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> > 



-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Thread:
Melfar
Mm W
Jvlad
Mathieu Suen
Jvlad
Lukas Kahwe Smith
Philip Olson
Jvlad
Jvlad
Richard Quadling
Jvlad
Melfar
Mathieu Suen
Richard Quadling
Stanislav Malyshev

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved