[PHP-DEV] Re: foreach statement add list supporting
Hi: RFC was moved to https://wiki.php.net/rfc/foreachlist. sorry for previous wrong folder rfc page, I have deleted previous one. thanks 2011/7/6 Xinchen Hui larue...@gmail.com: Hi: T_LIST is not allowed to used with foreach before. and then there comes a freature request: #10203 allow foreach($array as list($a,$b) I have work on it, and now submit patch to internal. I have set up a rfc page in wiki.php.net: https://wiki.php.net/foreachlist do you think this can be involved in PHP-5.4.0? ps: sorry for my english. thanks -- Xinchen Hui Laruence http://www.laruence.com -- 惠新宸 laruence Senior PHP Engineer http://www.laruence.com -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] [RFC] foreach_variable supporting T_LIST token
Hi: T_LIST is not allowed to used with foreach before. and then there comes a freature request: #10203 allow foreach($array as list($a,$b) I have work on it, and now submit patch to internal. I have set up a rfc page in wiki.php.net: https://wiki.php.net/rfc/foreachlist do you think this can be involved in PHP-5.4.0? ps: sorry for my poor english. and this was a re-post with title changed. thanks -- Xinchen Hui Laruence http://www.laruence.com -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [RFC] foreach_variable supporting T_LIST token
2011/7/6 Xinchen Hui larue...@gmail.com: Hi: T_LIST is not allowed to used with foreach before. and then there comes a freature request: #10203 allow foreach($array as list($a,$b) Ironically enough you managed to miss the last closing ), enforcing the point of this not being a natural syntax. Furthermore, without reading the RFC, is this the same as foreach($array as $a = $b) {} or foreach($array as $e) { list($a, $b) = $e; } or.. ? that really doesn't look like something PHP should support imo. -Hannes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [RFC] foreach_variable supporting T_LIST token
Hi, On 07/06/2011 03:06 PM, Hannes Magnusson wrote: 2011/7/6 Xinchen Hui larue...@gmail.com: T_LIST is not allowed to used with foreach before. and then there comes a freature request: #10203 allow foreach($array as list($a,$b) Ironically enough you managed to miss the last closing ), enforcing the point of this not being a natural syntax. Furthermore, without reading the RFC, is this the same as foreach($array as $a = $b) {} No, there $a would be the key. Intention would be, as I read the RFC, that this could be an arbitrary list. or foreach($array as $e) { list($a, $b) = $e; } Yes, I understood if like that. Just a short notation. or.. ? that really doesn't look like something PHP should support imo. Don't see too many bad things about the idea ... Regards, Stefan -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [RFC] foreach_variable supporting T_LIST token
Hi: first of all, I am a guy whose english is poor, sorry for making you confuse. the feature request is here: https://bugs.php.net/bug.php?id=10203 and I think this can make php code more flexible, and more making sense. example: foreach (array( array(3, array(1, 2)), array(7, array(3, 4)), ) as list($sum, list($op1, $op2))) { printf(%d + %d = %d\n, $op1, $op2, $sum); } output: 1 + 2 = 3 3 + 4 = 7 plz read the RFC for more details. thanks 2011/7/6 Stefan Neufeind neufe...@php.net: Hi, On 07/06/2011 03:06 PM, Hannes Magnusson wrote: 2011/7/6 Xinchen Hui larue...@gmail.com: T_LIST is not allowed to used with foreach before. and then there comes a freature request: #10203 allow foreach($array as list($a,$b) Ironically enough you managed to miss the last closing ), enforcing the point of this not being a natural syntax. Furthermore, without reading the RFC, is this the same as foreach($array as $a = $b) {} No, there $a would be the key. Intention would be, as I read the RFC, that this could be an arbitrary list. or foreach($array as $e) { list($a, $b) = $e; } Yes, I understood if like that. Just a short notation. or.. ? that really doesn't look like something PHP should support imo. Don't see too many bad things about the idea ... Regards, Stefan -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php -- 惠新宸 laruence Senior PHP Engineer http://www.laruence.com -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] [RFC] -W option for CLI strict mode
On July-06-11 12:58 AM Adam Harvey wrote: On 6 July 2011 06:00, Richard Quadling rquadl...@gmail.com wrote: I'd also add in the display_startup_errors to this also. As I see it, the idea is to make things as noisy or as quiet as possible. Agreed. That was an oversight on my part. I'll update the patches to handle that as well. Nice. I have use for this. Best Regards, Mike Robinson -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [RFC] -W option for CLI strict mode
On 6 July 2011 15:14, Mike Robinson m...@rile.ca wrote: On July-06-11 12:58 AM Adam Harvey wrote: On 6 July 2011 06:00, Richard Quadling rquadl...@gmail.com wrote: I'd also add in the display_startup_errors to this also. As I see it, the idea is to make things as noisy or as quiet as possible. Agreed. That was an oversight on my part. I'll update the patches to handle that as well. Nice. I have use for this. Best Regards, Mike Robinson What happens of both LOUD and quiet are used. Personally, I'd say this is an error and abort. -- Richard Quadling Twitter : EE : Zend : PHPDoc @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [RFC] -W option for CLI strict mode
On Tue, 2011-07-05 at 16:50 +0100, Richard Quadling wrote: C:\php5\php.exe --verbose -f d:\docs\phd\render.php -- --verbose That happens with all options. $ php -n run-tests.php -n Non bikeshedding thought ... Being able to enable full error reporting at the command line has to be complimented though by fully disabling error reporting ... -Q, --quiet or -S, --silent What would happen with logging then? Will that be switched off, too? johannes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [RFC] -W option for CLI strict mode
2011/7/6 Johannes Schlüter johan...@schlueters.de: On Tue, 2011-07-05 at 16:50 +0100, Richard Quadling wrote: C:\php5\php.exe --verbose -f d:\docs\phd\render.php -- --verbose That happens with all options. $ php -n run-tests.php -n You missed out the -- That separates arguments from php.exe and the script. As long as one remembers that, they should be OK. Non bikeshedding thought ... Being able to enable full error reporting at the command line has to be complimented though by fully disabling error reporting ... -Q, --quiet or -S, --silent What would happen with logging then? Will that be switched off, too? If error_reporting() is set to 0, what errors can be generated? -- Richard Quadling Twitter : EE : Zend : PHPDoc @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [RFC] -W option for CLI strict mode
On 6 July 2011 16:04, Richard Quadling rquadl...@gmail.com wrote: On 6 July 2011 15:14, Mike Robinson m...@rile.ca wrote: On July-06-11 12:58 AM Adam Harvey wrote: On 6 July 2011 06:00, Richard Quadling rquadl...@gmail.com wrote: I'd also add in the display_startup_errors to this also. As I see it, the idea is to make things as noisy or as quiet as possible. Agreed. That was an oversight on my part. I'll update the patches to handle that as well. Nice. I have use for this. Best Regards, Mike Robinson What happens of both LOUD and quiet are used. Personally, I'd say this is an error and abort. An error, and abort silently. :) -- Richard Quadling Twitter : EE : Zend : PHPDoc @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea -- 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
Re: [PHP-DEV] [RFC] -W option for CLI strict mode
On Wed, 2011-07-06 at 16:46 +0100, Richard Quadling wrote: 2011/7/6 Johannes Schlüter johan...@schlueters.de: On Tue, 2011-07-05 at 16:50 +0100, Richard Quadling wrote: C:\php5\php.exe --verbose -f d:\docs\phd\render.php -- --verbose That happens with all options. $ php -n run-tests.php -n You missed out the -- That separates arguments from php.exe and the script. As long as one remembers that, they should be OK. This is not needed usually: $ cat t.php ?php print_r($argv); $ php -n t.php -n Array ( [0] = t.php [1] = -n ) Non bikeshedding thought ... Being able to enable full error reporting at the command line has to be complimented though by fully disabling error reporting ... -Q, --quiet or -S, --silent What would happen with logging then? Will that be switched off, too? If error_reporting() is set to 0, what errors can be generated? Well that's exactly the question: Is that expected or is it just supposed to be silent on the console only? (same for -W btw.) johannes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] [RFC] -W option for CLI strict mode
On July-06-11 11:49 AM Peter Cowburn [mailto:petercowb...@gmail.com] On 6 July 2011 16:04, Richard Quadling rquadl...@gmail.com wrote: What happens of both LOUD and quiet are used. Personally, I'd say this is an error and abort. An error, and abort silently. :) Whatever the consensus is. :) The devil's in the details of course (and that's easy for me to say since I'm not doing the work). But overall I'd say this is a nice, simple, useful feature. Best Regards, Mike Robinson -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] SVN Account Request: orange_ribbon
I would submit additions to the math functions already included. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php