On Sun, 19 Dec 2010 15:12:17 -0000, Hannes Magnússon
<hannes.magnus...@gmail.com> wrote:
On Sun, Dec 19, 2010 at 16:05, Gustavo Lopes <glo...@nebm.ist.utl.pt>
wrote:
On Sun, 19 Dec 2010 15:03:22 -0000, Hannes Magnússon
<hannes.magnus...@gmail.com> wrote:
On Sun, Dec 19, 2010 at 15:49, Gustavo Lopes <glo...@nebm.ist.utl.pt>
wrote:
On Sun, 19 Dec 2010 05:33:56 -0000, Matthew Turland
<tobias...@gmail.com> wrote:
Attached are source/test and manual patches for the addition of two
methods to the SplObjectStorage class. These methods, removeCommon
and removeUncommon, add support for the difference and intersection
set
operations, respectively.
I'm sorry, I must be missing something because what exactly is the
difference between removeCommon and removeAll?
Is this just bikeshedding over the method names, or did you not bother
reading the patches? (the doc patch even includes examples).
I did, and near the end it has:
SPL_ME(SplObjectStorage, removeAll, arginfo_Object, 0)
+ SPL_ME(SplObjectStorage, removeCommon, arginfo_Object, 0)
So there's already a removeAll.
Read the doc patch. The description says it all, but if you still
wonder then look at the example.
In the example, substituting removeCommon by removeAll has exactly the
same result:
<?php
$a = (object) 'a';
$b = (object) 'b';
$c = (object) 'c';
$foo = new SplObjectStorage;
$foo->attach($a);
$foo->attach($b);
$bar = new SplObjectStorage;
$bar->attach($b);
$bar->attach($c);
$foo->removeAll($bar);
var_dump($foo->contains($a));
var_dump($foo->contains($b));
gives
bool(true)
bool(false)
Could you please explain the difference instead of telling me to RTFP?
--
Gustavo Lopes
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php