<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel rdf:about="http://permalink.gmane.org/gmane.comp.php.devel">
    <title>gmane.comp.php.devel</title>
    <link>http://permalink.gmane.org/gmane.comp.php.devel</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.php.devel/80628"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.php.devel/80627"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.php.devel/80626"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.php.devel/80625"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.php.devel/80624"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.php.devel/80623"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.php.devel/80622"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.php.devel/80621"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.php.devel/80620"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.php.devel/80619"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.php.devel/80618"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.php.devel/80617"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.php.devel/80616"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.php.devel/80615"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.php.devel/80614"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.php.devel/80613"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.php.devel/80612"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.php.devel/80611"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.php.devel/80610"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.php.devel/80609"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.php.devel/80628">
    <title>Re: [PHP-DEV] PR 287 - added use_keys argument to array_filter() [Discussion]</title>
    <link>http://permalink.gmane.org/gmane.comp.php.devel/80628</link>
    <description>&lt;pre&gt;

On 19 Jun, 2013, at 1:04 AM, Patrick Schaaf &amp;lt;bof&amp;lt; at &amp;gt;bof.de&amp;gt; wrote:

I've mirrored the behaviour of this feature from JavaScript as much as possible (but obviously without passing the array itself as the third argument). As such I don't feel there's a need to introduce yet another function just so that the key is passed as the first argument. And to use both key and value forces the developer to use closures instead of just any callback unless this means the second argument passed to the callback is the array :)

I see some potential here, albeit a bit more magical :) Let's see how the discussion progresses. 

&lt;/pre&gt;</description>
    <dc:creator>Tjerk Meesters</dc:creator>
    <dc:date>2013-06-18T23:15:45</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.php.devel/80627">
    <title>Re: [PHP-DEV] PR 287 - added use_keys argument to array_filter() [Discussion]</title>
    <link>http://permalink.gmane.org/gmane.comp.php.devel/80627</link>
    <description>&lt;pre&gt;

In this case, I have a strong doubt that the "better functionality" will be
used, nor that it is indeed "better" at all. I also much prefer,
aesthetically, the _key() API over appending a flags parameter: though that
is likely, largely due to the familiarity mentioned earlier. Quite frankly
the simpler, more familiar approach looks best to me.

Also, please don't put words into my mouth: nowhere did I say, "we
shouldn't provide better functionality **just because it would make all the
other poorly written functions look bad**" (emphasis mine).

I appreciate you having an alternative viewpoint, but try not to see what
isn't there. What I *was* saying is that the other functions are there,
they do a great job and have been for a long time. Why not make use of that
array-function-muscle-memory; put it to our advantage?

To swing over to the other side of the fence, I do see that the flags-based
approach would "work" just as well in terms of getting the functionality
out there.  It is something I have thought &lt;/pre&gt;</description>
    <dc:creator>Peter Cowburn</dc:creator>
    <dc:date>2013-06-18T23:09:09</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.php.devel/80626">
    <title>Re: [PHP-DEV] PR 287 - added use_keys argument to array_filter() [Discussion]</title>
    <link>http://permalink.gmane.org/gmane.comp.php.devel/80626</link>
    <description>&lt;pre&gt;

Are you saying that it's better to have familiarity over functionality?

I'm not sure I agree with this premise of we shouldn't provide
better functionality just because it would make all the other poorly
written functions look bad. That's setting a lower bar of standards, isn't
it?


&lt;/pre&gt;</description>
    <dc:creator>Sherif Ramadan</dc:creator>
    <dc:date>2013-06-18T22:21:41</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.php.devel/80625">
    <title>Re: [PHP-DEV] PR 287 - added use_keys argument to array_filter() [Discussion]</title>
    <link>http://permalink.gmane.org/gmane.comp.php.devel/80625</link>
    <description>&lt;pre&gt;


I'm very much on the "new function" side of the fence. Basic (one-word)
arguments for this include familiarity and simplicity. Familiarity, since
we're used to *_key functions for arrays. It will come as absolutely no
surprise to see the _key function spring up out of nowhere and its use is
blindingly obvious for anyone who has ever used array_filter(). Simplicity
since, err.. what were those flags again? is it $key first or $value? is
there an ARRAY_FILTER_BOTH? Also, I don't pretend my time with PHP covers
everything that everyone has ever done or wanted to do, but I cannot think
of a time when I wanted to filter an array on both the key *and* the value
at the same time: of course, it's easy to make up use cases.
&lt;/pre&gt;</description>
    <dc:creator>Peter Cowburn</dc:creator>
    <dc:date>2013-06-18T22:08:22</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.php.devel/80624">
    <title>Re: [PHP-DEV] PR 287 - added use_keys argument to array_filter() [Discussion]</title>
    <link>http://permalink.gmane.org/gmane.comp.php.devel/80624</link>
    <description>&lt;pre&gt;

This is also the order already used for the callback of array_walk, so I
think it makes sense to have some consistency. (Even if I never liked the
order of the array_walk callback :))
&lt;/pre&gt;</description>
    <dc:creator>Leigh</dc:creator>
    <dc:date>2013-06-18T17:30:03</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.php.devel/80623">
    <title>Re: [PHP-DEV] PR 287 - added use_keys argument to array_filter() [Discussion]</title>
    <link>http://permalink.gmane.org/gmane.comp.php.devel/80623</link>
    <description>&lt;pre&gt;

Of course not, the premise was that this would be the result if there was
no third argument and the function would pass the key to the callback by
default (in response to the comment above about removing the third
argument).


The current patch does not force the callback to take two arguments. By
default the existing behavior is maintained since the third argument is
false by default. I still don't hear a good argument for adding a new
function.



I would agree that this is a better solution than the existing patch allows
since the function name does not suggest the filtering of a key or
otherwise. In that case it would be easy to use bit-wise operators to get
both the key and the element into the callback or just one or the other.
The default would be ARRAY_FILTER_VAL, obviously.

I suppose the order of the elements should remain $value, $key in the event
of ARRAY_FILTER_KEY | ARRAY_FILTER_VAL.


&lt;/pre&gt;</description>
    <dc:creator>Sherif Ramadan</dc:creator>
    <dc:date>2013-06-18T17:24:15</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.php.devel/80622">
    <title>Re: [PHP-DEV] PR 287 - added use_keys argument to array_filter() [Discussion]</title>
    <link>http://permalink.gmane.org/gmane.comp.php.devel/80622</link>
    <description>&lt;pre&gt;
That look like a fairly decent compromise of all the suggestions so far.
&lt;/pre&gt;</description>
    <dc:creator>Leigh</dc:creator>
    <dc:date>2013-06-18T17:07:58</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.php.devel/80621">
    <title>Re: [PHP-DEV] PR 287 - added use_keys argument to array_filter() [Discussion]</title>
    <link>http://permalink.gmane.org/gmane.comp.php.devel/80621</link>
    <description>&lt;pre&gt;That's

Existing code won't pass that third, true, argument to array_filter(), and
thus will not break.

Nevertheless, I'd say go with a new array_filter_key() function, because
that permits using existing one-parameter functions like that strlen as a
callback, instead of forcing two-parameter callback functions.

Another alternative might be to go with a third argument to array_filter(),
but make that an integer with ORable constants ARRAY_FILTER_KEY,
ARRAY_FILTER_VAL - only one of them set calls with a single argument, both
set call with two arguments.

best regards
  Patrick
&lt;/pre&gt;</description>
    <dc:creator>Patrick Schaaf</dc:creator>
    <dc:date>2013-06-18T17:04:20</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.php.devel/80620">
    <title>Re: [PHP-DEV] PR 287 - added use_keys argument to array_filter() [Discussion]</title>
    <link>http://permalink.gmane.org/gmane.comp.php.devel/80620</link>
    <description>&lt;pre&gt;
That is a worse outcome, sure, but there is still danger in the former
scenario given that defaulting the callback to take two arguments causes
the wrong result:

var_dump(array_filter(['foo', '', 'bar'], 'strlen', true));

Warning: strlen() expects exactly 1 parameter, 2 given in - on line 1

Warning: strlen() expects exactly 1 parameter, 2 given in - on line 1

Warning: strlen() expects exactly 1 parameter, 2 given in - on line 1
array(0) {
}


Not only do we trigger the error handler (a large enough array causes a
performance issue), but we also get back an empty array as a result. That's
BC and performance loss that's simply unacceptable, so defaulting the
behavior to pass the key is simply out of the question.


&lt;/pre&gt;</description>
    <dc:creator>Sherif Ramadan</dc:creator>
    <dc:date>2013-06-18T16:42:31</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.php.devel/80619">
    <title>Re: [PHP-DEV] PR 287 - added use_keys argument to array_filter() [Discussion]</title>
    <link>http://permalink.gmane.org/gmane.comp.php.devel/80619</link>
    <description>&lt;pre&gt;


I'm not sure how that's a real problem. All built in PHP functions specify
a signature.
&lt;/pre&gt;</description>
    <dc:creator>Sherif Ramadan</dc:creator>
    <dc:date>2013-06-18T16:39:05</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.php.devel/80618">
    <title>Re: [PHP-DEV] PR 287 - added use_keys argument to array_filter() [Discussion]</title>
    <link>http://permalink.gmane.org/gmane.comp.php.devel/80618</link>
    <description>&lt;pre&gt;
That actually isn't a bad idea. I would consider going that route if this
patch presents any real world problems that could be better solved with
introducing a new function. I just don't see any reason for a new function
now given that this patch does not present any BC and can still solve the
same problem without adding a new function.


The problem with having one callback for just the keys and another for the
array elements is that you're stuck in a situation where you can't possibly
use both. We have that problem with array sort functions that allow a user
defined callback. For example, we have usort and uksort, but there is no
sort function that can offer both. It's plausible that a user may be
relying on both in certain cases (for a example a map of maps).



I would like to solve the problem without introducing new problems. If I
can do that we get PHP to take a step forward and not a step side-ways.
&lt;/pre&gt;</description>
    <dc:creator>Sherif Ramadan</dc:creator>
    <dc:date>2013-06-18T16:38:25</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.php.devel/80617">
    <title>Re: [PHP-DEV] PR 287 - added use_keys argument to array_filter() [Discussion]</title>
    <link>http://permalink.gmane.org/gmane.comp.php.devel/80617</link>
    <description>&lt;pre&gt;

The danger actually lurks in the cases whereby the second argument is
accepted and with that (sometimes radically) change the semantics of the
function; in fact, quite a few internal functions have this kind of
switch-by-argument behaviour, such as "array_keys" to randomly name one.
 And admittedly, this function when my PR goes through ;-)



&lt;/pre&gt;</description>
    <dc:creator>Tjerk Anne Meesters</dc:creator>
    <dc:date>2013-06-18T15:37:42</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.php.devel/80616">
    <title>Re: [PHP-DEV] PR 287 - added use_keys argument to array_filter() [Discussion]</title>
    <link>http://permalink.gmane.org/gmane.comp.php.devel/80616</link>
    <description>&lt;pre&gt;
If `strlen` can't handle extra parameters then I'd say *that* is a real
problem, this PR aside.
&lt;/pre&gt;</description>
    <dc:creator>Levi Morrison</dc:creator>
    <dc:date>2013-06-18T15:28:41</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.php.devel/80615">
    <title>Re: [PHP-DEV] PR 287 - added use_keys argument to array_filter() [Discussion]</title>
    <link>http://permalink.gmane.org/gmane.comp.php.devel/80615</link>
    <description>&lt;pre&gt;

Why not use array_filter_keys?

There are many other array functions that work with keys using this naming
pattern. This would make it clearer in the code what is being filtered, and
no need for the additional parameter.

In this case I think I would still prefer it if the callback took a single
parameter. Values can still be easily looked up with $array[$key] in user
defined callbacks, but all of the built-in functions that take a single
parameter are still available to use.
&lt;/pre&gt;</description>
    <dc:creator>Leigh</dc:creator>
    <dc:date>2013-06-18T15:27:04</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.php.devel/80614">
    <title>Re: [PHP-DEV] PR 287 - added use_keys argument to array_filter() [Discussion]</title>
    <link>http://permalink.gmane.org/gmane.comp.php.devel/80614</link>
    <description>&lt;pre&gt;


See the discussion on github for that PR
https://github.com/php/php-src/pull/287#issuecomment-14175109 unfortunately
we can't do that as it will break lots of userspace code that might be
doing stuff like array_filter(['foo','','bar'], 'strlen') where strlen only
accepts a single argument and in those cases the result will be triggering
lots of warnings and failed code.
&lt;/pre&gt;</description>
    <dc:creator>Sherif Ramadan</dc:creator>
    <dc:date>2013-06-18T15:07:24</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.php.devel/80613">
    <title>Re: [PHP-DEV] PR 287 - added use_keys argument to array_filter() [Discussion]</title>
    <link>http://permalink.gmane.org/gmane.comp.php.devel/80613</link>
    <description>&lt;pre&gt;It might be considered a BC break, but I really think we should drop the
boolean argument; just have it pass the key as parameter 2 always.
&lt;/pre&gt;</description>
    <dc:creator>Levi Morrison</dc:creator>
    <dc:date>2013-06-18T14:58:07</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.php.devel/80612">
    <title>[PHP-DEV] PR 287 - added use_keys argument to array_filter() [Discussion]</title>
    <link>http://permalink.gmane.org/gmane.comp.php.devel/80612</link>
    <description>&lt;pre&gt;I'm starting up a thread for discussion on Pull Request 287
https://github.com/php/php-src/pull/287 (allowing array keys to be passed
to the callback function of array_filter through a third optional boolean
argument). I would like to merge this into master and as discussed on IRC
it would probably be a good idea to startup a discussion and make sure
there aren't any objections or clarifications not yet voiced.

The patch has no BC because the third argument is optional and defaults to
false. Personally, I have always thought it would be a good idea to be able
to get the keys into the array_filter callback since I've stumbled across a
few scenarios where that would have made things easier.

I'm not sure if there are any particular down sides to this option being
added, but none that I can find. It currently passes all tests in master
and works as expected.

Thoughts, opinions, objections, concerns?


- Sherif
&lt;/pre&gt;</description>
    <dc:creator>Sherif Ramadan</dc:creator>
    <dc:date>2013-06-17T23:20:37</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.php.devel/80611">
    <title>[PHP-DEV] Re: [VOTE] Internal operator overloading and GMP improvments</title>
    <link>http://permalink.gmane.org/gmane.comp.php.devel/80611</link>
    <description>&lt;pre&gt;

Vote is closed now. RFC accepted (on both counts).

Nikita
&lt;/pre&gt;</description>
    <dc:creator>Nikita Popov</dc:creator>
    <dc:date>2013-06-17T15:22:58</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.php.devel/80610">
    <title>Re: [PHP-DEV] pull reqs broken in bugs.php.net?</title>
    <link>http://permalink.gmane.org/gmane.comp.php.devel/80610</link>
    <description>&lt;pre&gt;Hi,

On Mon, 2013-06-17 at 11:07 +0200, Ferenc Kovacs wrote:

Yes, most likely.


I will look into this. The whole PR thing currently is not nicely done,
I always hoped somebody improves it :)

johannes




&lt;/pre&gt;</description>
    <dc:creator>Johannes Schlüter</dc:creator>
    <dc:date>2013-06-17T09:48:53</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.php.devel/80609">
    <title>Re: [PHP-DEV] pull reqs broken in bugs.php.net?</title>
    <link>http://permalink.gmane.org/gmane.comp.php.devel/80609</link>
    <description>&lt;pre&gt;

I've manually removed the linked PR for #64549 for now.

&lt;/pre&gt;</description>
    <dc:creator>Ferenc Kovacs</dc:creator>
    <dc:date>2013-06-17T09:13:55</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.php.devel/80608">
    <title>Re: [PHP-DEV] pull reqs broken in bugs.php.net?</title>
    <link>http://permalink.gmane.org/gmane.comp.php.devel/80608</link>
    <description>&lt;pre&gt;
I suppose somebody added manually (maybe selected a bad PR.
I agree that there should be a button to remove the link to a given PR and
it would be also nice if there would be an entry in the history about who
linked/unlinked a PR.

&lt;/pre&gt;</description>
    <dc:creator>Ferenc Kovacs</dc:creator>
    <dc:date>2013-06-17T09:07:43</dc:date>
  </item>
  <textinput rdf:about="http://search.gmane.org/?group=$group=gmane.comp.php.devel">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.comp.php.devel</link>
  </textinput>
</rdf:RDF>
