Re: [PHP-DEV] Regarding constructions like func()[0]

2009-11-10 Thread Mathieu Suen
melfar a écrit : 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

Re: [PHP-DEV] Regarding constructions like func()[0]

2009-11-10 Thread Stanislav Malyshev
Hi! Whilst you are all thinking about this, how about ... $value = (function(){return $x;})(); I tried implementing that but it's not straightforward because you need to keep the result of first call while everything inside () is calculated (which can be any number of expressions including

Re: [PHP-DEV] Regarding constructions like func()[0]

2009-11-09 Thread jvlad
If you care not to waste userland with new names, use namespaces, that's the way intruduced by php, and it is not javascript after all. I'm so old school in my coding, I've not got my head around namespaces yet. I'm just old. There is nothing really new in namespaces. For example the

Re: [PHP-DEV] Regarding constructions like func()[0]

2009-11-09 Thread David Zülke
It's already on the list for PHP6: http://wiki.php.net/summits/pdmnotesmay09 (see Day 2, PHP 6, #13). No need to discuss this further, I think. You might also want to have that bug closed, it's redundant. - David On 07.11.2009, at 12:42, melfar wrote: Hello! I have filed a bug

Re: [PHP-DEV] Regarding constructions like func()[0]

2009-11-09 Thread Philip Olson
On 07.11.2009, at 12:42, melfar 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? On Nov 9, 2009, at 1:41 AM, David Zülke wrote: It's already on the list for PHP6:

Re: [PHP-DEV] Regarding constructions like func()[0]

2009-11-09 Thread jvlad
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? On Nov 9, 2009, at 1:41 AM, David Zülke wrote: It's already on the list for PHP6: http://wiki.php.net/summits/pdmnotesmay09 (see Day 2,

Re: [PHP-DEV] Regarding constructions like func()[0]

2009-11-09 Thread Lukas Kahwe Smith
On 09.11.2009, at 18:46, jvlad wrote: 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? On Nov 9, 2009, at 1:41 AM, David Zülke wrote: It's already on the list for PHP6:

Re: [PHP-DEV] Regarding constructions like func()[0]

2009-11-08 Thread jvlad
melfar mel...@gmail.com wrote in message news:0f.f6.03668.ad206...@pb1.pair.com... 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

Re: [PHP-DEV] Regarding constructions like func()[0]

2009-11-08 Thread jvlad
Whilst you are all thinking about this, how about ... $value = (function(){return $x;})(); Being able to call an anonymous function inline would certainly be a useful mechanism. Allowing calls without creating dummy user land vars would be consistent with func()[0]. If you care not to

Re: [PHP-DEV] Regarding constructions like func()[0]

2009-11-08 Thread Richard Quadling
2009/11/8 jvlad d...@yandex.ru: Whilst you are all thinking about this, how about ... $value = (function(){return $x;})(); Being able to call an anonymous function inline would certainly be a useful mechanism. Allowing calls without creating dummy user land vars would be consistent with

[PHP-DEV] Regarding constructions like func()[0]

2009-11-07 Thread melfar
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

Re: [PHP-DEV] Regarding constructions like func()[0]

2009-11-07 Thread mm w
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

Re: [PHP-DEV] Regarding constructions like func()[0]

2009-11-07 Thread melfar
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

Re: [PHP-DEV] Regarding constructions like func()[0]

2009-11-07 Thread Richard Quadling
2009/11/7 melfar mel...@gmail.com: 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