« first day (3817 days earlier)      last day (1124 days later) » 

10:00 PM
AIUI, a security fix would go to 7.3 onwards; a bug fix to 7.4 onwards; and anything else to 8.1
except where it was fixing a feature that didn't exist back then
 
@IMSoP yeah, that's what a co-worker argued, he doesn't think it would be part of a minor release, but I'm hoping it would be >.>
 
@Tiffany It's a feature request
 
bear in mind also that if you get your PHP from Ubuntu or RedHat packages, they don't use the php.net releases anyway
they essentially have their own branches
 
@Girgias So part of 8.0.x but not 7.4.x?
 
@Tiffany It's 8.1
Except if I fucked up the merge
 
10:01 PM
>.< got it, thanks
Basically "I acknowledge your answer, even though it's not the answer I wanted to hear" :P
 
:p
You can always kinda use ext/csv :p
 
8.1 would be more likely at this point >.<
 
True especially as I don't really backport stuff (unless I've got most of what I want done)
 
@Girgias yes, it is also possible to file an RFC to make all decorating interators in SPL to intervene next() that could.
 
@Girgias except that we have universally agreed axioms for maths regarding that … unlike PHP.
 
10:06 PM
@hakre Okay just to make it clear one last time IF all the other iterators behave a different way from how LimitIterator behaves then EITHER all the other iterators are bugged and need to be aligned to how LimitIterator behaves OR LimitIterator needs to be fixed to behave like the others
@bwoebi From what I'm understanding in this whole issue it's is pretty similar where everything is consistent except something weird like 2+2 = 5 although 1+3 = 4 and 3 = 2+1, and arguing that because 2+2=5 we shouldn't change this because it's like that
 
@Girgias Please don't bark at me, I'm not the bug/feature type of guy and fine with improvements. no seeing though that the inner iterator which is a generator here next() never is called and then barking on LimitIterator to call it, well, have it your way.
 
Anyway, any proper iterator subiterating child iterators should do so by invoking valid() before every next()
 
@bwoebi the contract with foreach is to call next() before valid().
rewind, valid, key, current, next, valid , ...
 
eih, yes
you're right, mixed it up, but yes.
 
so the call to valid() before next() is already implicit.
And caching iterator should already capture next() as well as valid().
would need to check that thought.
 
10:24 PM
@hakre That does not mean that implementations cannot check validity themselves, in particularly with iterators that interact with other iterators.
foreach knows nothing about "decorators" and such. It's up to the iterator to define it.
 
@LeviMorrison absolutely true.
@LeviMorrison yeah, hence the iterator interface and just the contract for iteration to be calling rewind, valid, key, ... etc.. some iterators can even be iterated even they were never rewound (and some can not).
implementations could also throw on next() if not valid() and what not.
so yes, CachingIterator intervenes next as well: 3v4l.org/aWoPk
 
11:32 PM
@LeviMorrison this looks pretty much like foreach plus the check on $count:
function limit(\Iterator $inner, int $count) {
  if (1 > $count) return;
  foreach ($inner as $key => $value) {
      if (!$count--) {
          return;
      }
      yield $key => $value;
  }
}
( foreach -> while 3v4l.org/BS5HF )
 

« first day (3817 days earlier)      last day (1124 days later) »