Hi:
This feature introduces list() support in foreach constructs(more
info can be found here: https://wiki.php.net/rfc/foreachlist).
this could make the grammar more consistent, see following example:
<?php
$users = array(
array('Foo', 'Bar'),
array('Baz', 'Qux');
);
// Before
foreach ($users as $user) {
list($firstName, $lastName) = $user;
echo "First name: $firstName, last name: $lastName. ";
}
// After
foreach ($users as list($firstName, $lastName)) {
echo "First name: $firstName, last name: $lastName. ";
}
?>
previous discussion could be found at :
http://marc.info/?l=php-internals&m=134277050215818&w=2
please vote for this: https://wiki.php.net/rfc/foreachlist#vote
thanks :)
--
Laruence Xinchen Hui
http://www.laruence.com/
Hi:
This feature introduces list() support in foreach constructs(more
info can be found here: https://wiki.php.net/rfc/foreachlist).please vote for this: https://wiki.php.net/rfc/foreachlist#vote
Hi Lauruence!
Is this vote just for list() or also for error suppression? I'd vote
+1 on the first, but -1 on the second, so it would be nice to make it
more clear ;)
Nikita
Hi:
This feature introduces list() support in foreach constructs(more
info can be found here: https://wiki.php.net/rfc/foreachlist).please vote for this: https://wiki.php.net/rfc/foreachlist#vote
Hi Lauruence!
Is this vote just for list() or also for error suppression? I'd vote
+1 on the first, but -1 on the second, so it would be nice to make it
more clear ;)
Hi,
okey, I opened another vote for the foreach list with silent token
supporting.
thanks
Nikita
--
Laruence Xinchen Hui
http://www.laruence.com/
Hi:
This feature introduces list() support in foreach constructs(more
info can be found here: https://wiki.php.net/rfc/foreachlist).please vote for this: https://wiki.php.net/rfc/foreachlist#vote
Hi Lauruence!
Is this vote just for list() or also for error suppression? I'd vote
+1 on the first, but -1 on the second, so it would be nice to make it
more clear ;)
Hi,okey, I opened another vote for the foreach list with silent token
supporting.thanks
Nikita
Sorry, I feel like I missed the discussion phase of this RFC. I'm
unclear about how this behavior in the construct will affect existing
code. Currently, you can only use list() with arrays that have
sequential numeric keys starting from 0. So the follow does not
currently work with the list construct...
list($x, $y) = array('x'=>1, 'y'=>2); // This won't work
/* This won't work either.. at least not the way I'd expect because $y
will end up being 1 and $x will be null and an E_NOTICE
level error is
thrown. /
list($x, $y) = array(1=>1, 2=>2);
var_dump($x, $y);
/
NULL
int(1)
*/
While I see the use of the list construct as a minor improvement in
readability (it does add some syntactic sugar), I also can't imagine
that it makes things any more consistent, which is one of the points
of this RFC.
This also means that if we chose to avoid this extra level of
indirection by way of list in foreach constructs we can't expect to
access the key, which might make for another ambiguity and lead us
back to just using something like the following...
$array = array(
'Cape Cod' => array('lat' => 12.20, 'long' => 34.60),
'North Shore' => array('lat' => 18.72, 'long' => 4.11),
'Mount Erie' => array('lat' => 6.02, 'long' => 21.79),
);
foreach ($array as $point => $coordinates) {
$lat = $coordinates['lat'];
$long = $coordinates['long'];
echo "Coordinates for $point are: LAT = $lat, LONG = $long\n";
}
I understand we can simply say this would not be an ideal use case for
this, but then it becomes a tiny variation in syntax that only solves
a specific problem.
Hi:
Voting closed.
Result:
foreach supports list syntax: 11 for yes, 4 for no. accepted.
foreach supports list with silent token: 2 for yes, 10 for no. denied.
thanks for your great advise.
I will commit the patch later.
thanks
Hi:
This feature introduces list() support in foreach constructs(more
info can be found here: https://wiki.php.net/rfc/foreachlist).this could make the grammar more consistent, see following example:
<?php
$users = array(
array('Foo', 'Bar'),
array('Baz', 'Qux');
);// Before
foreach ($users as $user) {
list($firstName, $lastName) = $user;
echo "First name: $firstName, last name: $lastName. ";
}// After
foreach ($users as list($firstName, $lastName)) {
echo "First name: $firstName, last name: $lastName. ";
}
?>previous discussion could be found at :
http://marc.info/?l=php-internals&m=134277050215818&w=2please vote for this: https://wiki.php.net/rfc/foreachlist#vote
thanks :)
--
Laruence Xinchen Hui
http://www.laruence.com/
--
Laruence Xinchen Hui
http://www.laruence.com/
Hi:
Voting closed.Result: foreach supports list syntax: 11 for yes, 4 for no. accepted. foreach supports list with silent token: 2 for yes, 10 for no. denied. thanks for your great advise. I will commit the patch later.
thanks
Hi:
This feature introduces list() support in foreach constructs(more
info can be found here: https://wiki.php.net/rfc/foreachlist).this could make the grammar more consistent, see following example:
<?php
$users = array(
array('Foo', 'Bar'),
array('Baz', 'Qux');
);// Before
foreach ($users as $user) {
list($firstName, $lastName) = $user;
echo "First name: $firstName, last name: $lastName. ";
}// After
foreach ($users as list($firstName, $lastName)) {
echo "First name: $firstName, last name: $lastName. ";
}
?>previous discussion could be found at :
http://marc.info/?l=php-internals&m=134277050215818&w=2please vote for this: https://wiki.php.net/rfc/foreachlist#vote
thanks :)
--
Laruence Xinchen Hui
http://www.laruence.com/
Great, now I can do in PHP what I've been able to do in Python for
years, but with uglier syntax! :P
--
Andrew Faulds
http://ajf.me/
Hi!
foreach supports list syntax: 11 for yes, 4 for no. accepted.
foreach supports list with silent token: 2 for yes, 10 for no. denied.
And here's again the problem with this voting setup. With all these long
discussions about people not getting votes we have 15 people that
bothered to vote at all, and essentially the vote is decided by one or
two single votes, and the vote doesn't even have to be from a PHP
contributor - but the vote of anybody who can register on PHP wiki is
enough to decide questions on the core of the language. And I'm not
talking about "the voice of the masses" there but by a single vote of
anybody who bothers to vote, which 99% of people just do not.
I do not this it is a healthy state of things. Sorry to raise the topic
that was discussed 1000 times before, but the situation does not seem to
improve.
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227
On Sun, Aug 26, 2012 at 8:42 PM, Stas Malyshev smalyshev@sugarcrm.comwrote:
Hi!
foreach supports list syntax: 11 for yes, 4 for no. accepted.
foreach supports list with silent token: 2 for yes, 10 for no.
denied.And here's again the problem with this voting setup. With all these long
discussions about people not getting votes we have 15 people that
bothered to vote at all, and essentially the vote is decided by one or
two single votes, and the vote doesn't even have to be from a PHP
contributor - but the vote of anybody who can register on PHP wiki is
enough to decide questions on the core of the language. And I'm not
talking about "the voice of the masses" there but by a single vote of
anybody who bothers to vote, which 99% of people just do not.I do not this it is a healthy state of things. Sorry to raise the topic
that was discussed 1000 times before, but the situation does not seem to
improve.Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227--
I got a PHP Wiki account but couldn't vote. Are you sure the Wiki accounts
got the permissions to vote?
Hi!
I got a PHP Wiki account but couldn't vote. Are you sure the Wiki
accounts got the permissions to vote?
Hm... Not sure, maybe somebody has to enable it?
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227
I got a PHP Wiki account but couldn't vote. Are you sure the Wiki
accounts got the permissions to vote?Hm... Not sure, maybe somebody has to enable it?
There is a special group ("voting" IIRC) for wiki accounts with voting
rights. "Ordinary" (non-php.net) wiki account holders cannot vote.
Someone with DB access would need to check, but I believe there are
(were) only a couple of people in this special voting group.
I got a PHP Wiki account but couldn't vote. Are you sure the Wiki
accounts got the permissions to vote?Hm... Not sure, maybe somebody has to enable it?
There is a special group ("voting" IIRC) for wiki accounts with voting
rights. "Ordinary" (non-php.net) wiki account holders cannot vote.
Someone with DB access would need to check, but I believe there are
(were) only a couple of people in this special voting group.
There are 1651 persons with php.net VCS account. There is however no
way to tell how active they are.
There are 2 people with specific voting karma, I think Pierre demanded
they got karma.
Noone else can vote. That should be obvious by looking up the names of
the voters on http://people.php.net.
And why is this discussion buried in a foreach() voting announcement thread?
-Hannes
Hi!
foreach supports list syntax: 11 for yes, 4 for no. accepted.
foreach supports list with silent token: 2 for yes, 10 for no. denied.And here's again the problem with this voting setup. With all these long
discussions about people not getting votes we have 15 people that
bothered to vote at all, and essentially the vote is decided by one or
two single votes, and the vote doesn't even have to be from a PHP
contributor - but the vote of anybody who can register on PHP wiki is
enough to decide questions on the core of the language. And I'm not
talking about "the voice of the masses" there but by a single vote of
anybody who bothers to vote, which 99% of people just do not.
Only people with a VCS account (or voting group) can vote.
Nikita
Hi!
Only people with a VCS account (or voting group) can vote.
OK, I stand corrected then, but participation rate is still awfully low.
We can't talk about consensus when everything is decided on one vote.
--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227
Maybe the simplest solution is we have a minimum participation rate before
voting can be closed?
On Sun, Aug 26, 2012 at 1:58 PM, Stas Malyshev smalyshev@sugarcrm.comwrote:
Hi!
Only people with a VCS account (or voting group) can vote.
OK, I stand corrected then, but participation rate is still awfully low.
We can't talk about consensus when everything is decided on one vote.--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227
Maybe the simplest solution is we have a minimum participation rate before
voting can be closed?Though it make sense - it's a problem, because it'll delay and reject some
useful features because of requirements issue.
On Sun, Aug 26, 2012 at 1:58 PM, Stas Malyshev <smalyshev@sugarcrm.com
wrote:
Hi!
Only people with a VCS account (or voting group) can vote.
OK, I stand corrected then, but participation rate is still awfully low.
We can't talk about consensus when everything is decided on one vote.
+1
But giving vote for anybody is kind of bad idea too... so its a problem
Yahav Gindi Bar wrote:
OK, I stand corrected then, but participation rate is still awfully low.
We can't talk about consensus when everything is decided on one vote.
+1
But giving vote for anybody is kind of bad idea too... so its a problem
Currently how many people ARE entitled to vote anyway?
And how many of those have been active in the last year?
( And how many here would like to be able to vote? )
--
Lester Caine - G8HFL
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk
Yahav Gindi Bar wrote:
OK, I stand corrected then, but participation rate is still awfully low.
We can't talk about consensus when everything is decided on one vote.
+1
But giving vote for anybody is kind of bad idea too... so its a problemCurrently how many people ARE entitled to vote anyway?
And how many of those have been active in the last year?( And how many here would like to be able to vote? )
--
Lester Caine - G8HFLContact - http://lsces.co.uk/wiki/?page=**contacthttp://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.**ukhttp://rainbowdigitalmedia.co.uk--
From the recent voting, the average participates is 10...
https://wiki.php.net/rfc/foreachlist
https://wiki.php.net/rfc/apxs-loadmodule/results
https://wiki.php.net/rfc/datetime_and_daylight_saving_time/vote
https://wiki.php.net/rfc/finally
https://wiki.php.net/rfc/constdereference
I'd like! ;).
(Though I've joined the group only month or two ago...)
Maybe the simplest solution is we have a minimum participation rate before
voting can be closed?Though it make sense - it's a problem, because it'll delay and reject some
useful features because of requirements issue.
If it is useful it should have enough supporters, else it most likely
isn't useful. While there should be an option to actively abstain from
voting.
johannes
hi,
On Tue, Aug 28, 2012 at 2:21 AM, Johannes Schlüter
johannes@schlueters.de wrote:
Maybe the simplest solution is we have a minimum participation rate before
voting can be closed?Though it make sense - it's a problem, because it'll delay and reject some
useful features because of requirements issue.If it is useful it should have enough supporters, else it most likely
isn't useful. While there should be an option to actively abstain from
voting.
I am not sure the usefulness of this option, but it is possible to add
a blank field ot any vote.
If the idea is to say 'I do not care enough to vote yes or no' then
simply vote no as one obviously either did not the RFC or do not want
it.
But this is off topic again in this thread, what's about creating a
separate one if you feel like we need to refine this process?
Cheers,
Pierre
@pierrejoye | http://blog.thepimp.net | http://www.libgd.org
I just noticed the RFC is listed in the Accepted category. Did something
change with the 2/3rds voting requirement? Right now, it stands at 64% Yes.
hi,
On Tue, Aug 28, 2012 at 2:21 AM, Johannes Schlüter
johannes@schlueters.de wrote:Maybe the simplest solution is we have a minimum participation rate
before
voting can be closed?Though it make sense - it's a problem, because it'll delay and reject
some
useful features because of requirements issue.If it is useful it should have enough supporters, else it most likely
isn't useful. While there should be an option to actively abstain from
voting.I am not sure the usefulness of this option, but it is possible to add
a blank field ot any vote.If the idea is to say 'I do not care enough to vote yes or no' then
simply vote no as one obviously either did not the RFC or do not want
it.But this is off topic again in this thread, what's about creating a
separate one if you feel like we need to refine this process?Cheers,
Pierre
@pierrejoye | http://blog.thepimp.net | http://www.libgd.org
I just noticed the RFC is listed in the Accepted category. Did something
change with the 2/3rds voting requirement? Right now, it stands at 64% Yes.
I think some naughty folks might have snuck votes in after voting was
over. It was certainly >64% when accepted.
--
Andrew Faulds
http://ajf.me/
I just noticed the RFC is listed in the Accepted category. Did something
change with the 2/3rds voting requirement? Right now, it stands at 64% Yes.
Sorry, disregard that previous email. I didn't look at the vote before
sending it.
If you look at the vote at the moment, it's 11 to 4, or 11/15. That is
above 2/3rds, which is 10/15.
--
Andrew Faulds
http://ajf.me/
You're right. My apologies.
I just noticed the RFC is listed in the Accepted category. Did something
change with the 2/3rds voting requirement? Right now, it stands at 64%
Yes.Sorry, disregard that previous email. I didn't look at the vote before
sending it.If you look at the vote at the moment, it's 11 to 4, or 11/15. That is
above 2/3rds, which is 10/15.--
Andrew Faulds
http://ajf.me/
You're right. My apologies.
Good, I was a little worried that I might have missed something you
didn't. It's all well and good.
--
Andrew Faulds
http://ajf.me/
2012/8/27 Stas Malyshev smalyshev@sugarcrm.com:
Hi!
Only people with a VCS account (or voting group) can vote.
OK, I stand corrected then, but participation rate is still awfully low.
We can't talk about consensus when everything is decided on one vote.
How about send notification emails and if one didn't participate
any vote more than 3 years, then revoke karma.
If 3 years are too short, make it 4 or 5 years.
Obsolete accounts can be cleaned with this method.
Just an idea.
Regards,
--
Yasuo Ohgaki
yohgaki@ohgaki.net
Hi:
sorry to replying top.
this is really a minor features, so few people are interesting in
this. thus fewer people will vote for it.
if people interesting in the RFC, he will vote. so I think it's okey..
thanks
Hi!
foreach supports list syntax: 11 for yes, 4 for no. accepted.
foreach supports list with silent token: 2 for yes, 10 for no. denied.And here's again the problem with this voting setup. With all these long
discussions about people not getting votes we have 15 people that
bothered to vote at all, and essentially the vote is decided by one or
two single votes, and the vote doesn't even have to be from a PHP
contributor - but the vote of anybody who can register on PHP wiki is
enough to decide questions on the core of the language. And I'm not
talking about "the voice of the masses" there but by a single vote of
anybody who bothers to vote, which 99% of people just do not.I do not this it is a healthy state of things. Sorry to raise the topic
that was discussed 1000 times before, but the situation does not seem to
improve.Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227
--
Laruence Xinchen Hui
http://www.laruence.com/
Hi!
foreach supports list syntax: 11 for yes, 4 for no. accepted.
foreach supports list with silent token: 2 for yes, 10 for no. denied.And here's again the problem with this voting setup. With all these long
discussions about people not getting votes we have 15 people that
bothered to vote at all, and essentially the vote is decided by one or
two single votes, and the vote doesn't even have to be from a PHP
contributor - but the vote of anybody who can register on PHP wiki is
enough to decide questions
No. One has to get the vote/rfc karma. If that has changed, we have
you restore this restriction.
anybody who bothers to vote, which 99% of people just do not.
If one does not participate, his fault.
Btw, we also have the 2/3 rule for language change as well.
Cheers,
Pierre