« first day (2327 days earlier)      last day (2621 days later) » 

Wes
1:02 PM
@brzuchal noiiiiiiice
 
@Gordon you forgot if (achieve_notification_system_like_facebook_or_google()) { /* ... */ }
amateur ...
 
@Wes I started googling about exceptions in IntelliJ, most of missing in PHPStorm features already exists in IntelliJ
 
@JoeWatkins my code is what your code executes :P
 
@Wes and if someday @JoeWatkins 's throws from this PR github.com/php/php-src/pull/2366 will be in core that would be awesome
 
> Optimizer gives me a headache, I'm super unfamiliar with it (on purpose)
I lol'd @JoeWatkins :-P
 
Wes
1:10 PM
lol
 
:)
it's major freaky shit
I'm not sure I know what the finished version of that patch looks like, and so doubt it will be finished (by me) ...
nikita raised the point that swapping one unknown type of exception, for another unknown type of exception doesn't appear to be very valuable ... or sensible ...
and I don't want (and we can't do) checked exceptions, and can't model anything in the middle ...
 
so it is hard but not impossible, yes?
 
what is ?
 
model this feature?
 
fully checked exceptions are impractical to the point they approach impossible ... we cannot check what we do not have loaded
 
1:21 PM
ahhh, the loader :/
 
I don't know what the middle ground solution looks like, and am not sure it is the useful thing I imagined it to be ...
even if the model were found, some middle ground, it wouldn't solve this:
6 mins ago, by Joe Watkins
nikita raised the point that swapping one unknown type of exception, for another unknown type of exception doesn't appear to be very valuable ... or sensible ...
I hope I'm wrong, and there's a way for it to be useful, and practical ... but I don't see it ... anyone is welcome to run with it ...
I super hate that @throw is still in the docblock, I correct these at least once a day, sometimes 10 times in a day ... hate it
 
What does mean "swapping one unknown type of exception, for another unknown type of exception" ?
 
well if some code throws an unexpected exception (not declared in throws), we throw another exception - which is also unexpected (by the caller)
someone suggested we autowrap ... so that
function () throws FancyException {
    throw new RuntimeException();
}
the caller of that function would recv FancyException with parent RuntimeException
 
Right guys
 
1:28 PM
@JoeWatkins it would be a dev-time/debugging tool only though, IMO
the checks should be disabled in prod anyway
 
where @ @Jimbo ?
 
But I've never keynoted before. Any tips? I wouldn't want to do the usual boring-ass php community stuff
:-)
 
sweet
 
I might even reach out to Cal Evans or someone and ask for advice
 
@Jimbo appear on stage naked and do star jumps for one hour ...
(anywhere you go from there is improvement)
 
1:30 PM
and lunges
 
oh yeah, lunge, then star jump ... loop
@Jimbo good idea, or anthony maybe too
 
while ($naked) {
    lunge();
    star_jump();
}
 
#teamwork
 
@Jimbo also Jeremy and Lorna
 
@Jimbo you just hop on stage and perform Baby.
 
1:31 PM
Or Baby Got Back
 
the best keynote I ever heard was by Aral Balkan at DPC
 
I don't like features that are disabled in release
it's acceptable sometimes, like for assertions, because that's what they are meant to be ... but type checks disabled in release feels wrong to me
 
@JoeWatkins to me checked exceptions are in the same category as assertions
 
yeah but we can't do checked exceptions .. if in development we could, that would be worthwhile considering, but we cannot ... so we'd have some sort of half implemented thing during development, which may let bugs slip through the net, and then in production, nothing ...
 
I know where you are coming from but the "unexpected to other unexpected" thing makes me think I would never use it in prod, therefore I would need to be able to disable it or else I would just never use it
 
1:34 PM
what about wrapping ?
 
@Gordon What was good about it?
 
@Jimbo Your mother.
 
@JoeWatkins looks like testing code to me
 
the problem is not really from top level throws, it's from exceptions bubbling up the stack ... we can't check those exceptions because the function definition may not be loaded ... there's no way around it ... but, if we only allow one type in throws, we can wrap whatever is thrown from further down the stack into an expected exception
 
@JoeWatkins oh right, I totally missed that element of it, yes that makes more sense and would be useful in prod
I'd like it to emit an E_NOTICE when it happened
 
1:36 PM
I hate warnings
also, what if someone changes all warnings to exceptions ... we'll just create a total mess
 
Well it should be logged in some way, because it's a programming error
 
but is it though
 
@Jimbo basically everything. the performance was fluent, captivating and entertaining. Aral is a great stage person with lots of presence- He captured me from beginning to end. I had a feeling he cared personally for the topic. No offense to anyone in the PHP community, but I've never seen anyone of us do a better performance.
 
I don't want the language to hide my mistakes, I want it to tell me about them so I can fix them
 
in a world where the feature exists, it may not be a programming error, it may be correct usage of the feature
 
1:37 PM
@DaveRandom !!dave
 
@JoeWatkins is this some kind helpfull info ? docs.oracle.com/javase/tutorial/essential/exceptions/…
 
!!annoy peehaa
 
!!annoy dave
 
@PeeHaa @PeeHaa @PeeHaa @PeeHaa @PeeHaa @PeeHaa @PeeHaa @PeeHaa @PeeHaa @PeeHaa @PeeHaa @PeeHaa @PeeHaa @PeeHaa @PeeHaa @PeeHaa @PeeHaa @PeeHaa @PeeHaa
dave dave dave dave dave dave dave dave dave dave dave dave dave dave dave dave dave dave dave
 
lol
Damnit
Fucking flood protection
oh lol
fail even \o/
 
1:38 PM
yeh we could do with better pingable name resolution
 
> Here's the bottom line guideline: If a client can reasonably be expected to recover from an exception, make it a checked exception. If a client cannot do anything to recover from the exception, make it an unchecked exception.
 
we can't do checked exceptions, so we can't make the distinction between checked and unchecked exceptions ... it's not useful for us, no ...
 
@JoeWatkins OK then it should emit a new type of error, non-fatal and even, if you must, ignored by the default configuration. The way that I would want to use the feature is as a debugging tool. I accept what you are saying that there are other valid approaches to how it should be used, though. I would 100% definitely not use it unless I had some way to log it.
Equally I would not vote against it if it didn't work that way, I would just not use it
 
well you do have a way to log it, you can catch the exception and look at the parent tree
 
Yes but that is a) case-by-case and b) in the hands of the caller
i.e. doable but unnecessarily complex given that you could just have an E_STRICT-like warning which would deal with that for you, and could be ignored by those who don't care
 
1:44 PM
I hate warnings
and you have to assume that they are going to be turned into exceptions by a handler
 
!!? chris heilmann speaker tips
 
Search for "chris heilmann speaker tips" (https://www.google.com/search?q=chris+heilmann+speaker+tips&lr=lang_en)
• A few tricks about public speaking and stage ...… - 20 jun. 2013 - Preparing for my upcoming workshops on public speaking for Mozillians, I just collec… (https://www.christianheilmann.com/2013/06/20/a-few-tricks-about-public-speaking-and-stage-technology/)
• The road to being a kick-ass public speaker | Chr… - 11 apr. 2011 - Detailed notes. Today I am going to share a few tips and tricks about public speakin… (http://www.christianheilmann.com/2011/04/11/the-road-to-being-a-kic
 
@Jimbo ^
 
17 mins ago, by Joe Watkins
function () throws FancyException {
    throw new RuntimeException();
}
can I put other statements in that blcok @JoeWatkins?
 
huh ?
 
1:45 PM
@JoeWatkins like can I put my own trigger_error() call in there?
 
hmmm… PHPAVA \o/
 
sure, but if your statement throws an exception it will be wrapped ... if we do the wrapping thing
 
oh wait
sorry I misinterpretted that syntax
so how would I define the way in which it was wrapped?
 
you don't, the rte is set as parent of wrapping object (instanceof FancyException)
 
what if my method throws more than one type of exception?
 
1:48 PM
any type that is not instanceof FancyException would be wrapped
 
function()
    throws FancyException
    throws AnotherFancyException
    throws default OmgWtfAreYouEvenDoingException
{
    throw new \Exception;
}
/me hides
 
/me finds @DaveRandom hiding place and beats him with bat-o-nails
there's no logical order, and taking the parsed order doesn't make sense, will make it a headache during inheritance for the programmer ...
 
Then it'll throw wrapped \Exception instanceof FancyException and AnotherFancyException and third exception which is instanceof default OMG... :)
 
instanceof A and B ?
wat, throw three exceptions ?
 
@JoeWatkins inheritance is a problem, true
 
1:52 PM
No, 3 exceptions :P was joking only
 
I hate that more than warnings
okay good
 
I was gonna say @DaveRandom you need to deal then with 3 wrapped exceptions
 
no you'd get an OmgWtfAreYouEvenDoingException (that's the point of the default)
 
function() throws FancyException, AnotherFancyException, default OmgWtfAreYouEvenDoingException
{
    throw new \Exception;
}
why not with commas?
looks, strange with default
 
well whatever, I was thinking of C# constraints with that syntax but it doesn't really matter
the point was more that I would probably want a way to declare more than one expected type, having to declare a single super-type would limit the usefulness for me (although not eliminate it entirely)
 
1:57 PM
function(): LolObject throws FancyException <1> AnotherFancyException <3> default <2> LmfaoException { }
Wahey, ordering!
Brb I'm high on sugar
 
Joe is right though, whatever you do it becomes very tricky (verbose) when inheritance comes into play
 
Hey, fuck it, why not just: function(): <% asp %> {} and then we can return asp code to execute
 
I mean you could have something like throws parent::throws I guess but I hate that
 
*/me finds @_DaveRandom hiding place and beats him with bat-o-nails*
 
BT landline-only customers to receive price cut, which the company heralds as "fantastic news for both of them".
 
2:01 PM
I'm not any closer to a model that can work ...
I blame @PeeHaa
7
 
@JoeWatkins TravisCI has the fix in nightly, thanks to that phpunit.de/build-status.html is finally all green again.
 
mm.. seems to be snowing here?!
 
ominous ...
 
@Naruto lol. You get what you deserve
 
@PeeHaa didn't get any beer yet.. :(
 
2:08 PM
@SebastianBergmann excellent, will be in 7.1.3 release also, just in time ;)
@DaveRandom the mystery of the piece of paper with numbers on it remains unsolved ... now it's just hanging around on my desk, torturing me ...
 
ThW
@SebastianBergmann \o/
 
@JoeWatkins database IDs?
 
I wonder if @SebastianBergmann knew that phpunit would become his life project when he started it in 2004
 
@Gordon I started at some time in 2000 and published the first version in 2001.
 
@DaveRandom nope, I don't touch that directly
 
2:21 PM
Can someone please help me with this jquery library. I am not able to find out any workaround
-2
Q: Blueimp Jquery file Upload Plugin: Send multiple files

TarunIn my HTML Form element, I have two file type input elements. One file input element loaded dynamically ( on click of check box) and another one on page load time. I want to send both files to the server in one request. I want one progress bar showing percentage of data sent to the server. I am a...

 
I think I'll burn the piece of paper
 
@SebastianBergmann de.wikipedia.org/wiki/PHPUnit says 2004. time to edit some wikipedia
 
@JoeWatkins you should just put the numbers in a text file somewhere and scrap the paper
 
@Gordon See second to last paragraph of thephp.cc/news/2015/06/20-years-of-php-sb
 
@DaveRandom @PeeHaa I know you guys are very good at client side functionalities: ). Any help please : )
 
2:24 PM
@SebastianBergmann did you think it might be an all consuming thing though ?
 
@JoeWatkins No.
I hoped that some people would find it useful, yes.
 
@SebastianBergmann do you sometimes curse if for becoming so?
 
Wes
someone is trying phpstorm eap? how does the inline parameter hint feature feel so far for you?
 
@Gordon It's sometimes very frustrating. So many people complain about so many things. But then again, I know that what I do helps a lot of people. All in all it's more motivating than frustrating, I think.
The PHPUnit 6 release was very stressful. Too bad that entwickler.de/online/php/phpunit-6-interview-579774921.html is only available in German. I think that this interview would be valuable to have in English.
 
you must not have spent very long in the java world before taking inspiration from junit
I think you could have predicted what it would become, given more time in the java world ...
 
Wes
2:29 PM
 
it was smart to get out, or never get in whatever ... the java world is a dank and nasty place ...
 
Wes
i only wish it had a smaller font :\
 
Random Fun Fact: I met @SebastianBergmann at a PHP Unconf in Hamburg for the first time. I think in 2009. I approached him during the lunch break. I was very nervous. Then I asked him when he'd continue working on Xinc. I thought he was the developer of it. Turned out he wasn't and hated the project. That was very embarrassing.
Not sure if @SebastianBergmann still remembers. I hope he doesnt :D
 
@bwoebi @Gordon @ThW BTW: There are still (free) tickets available for the PHPUnit hackathon in Hamburg (tech.kartenmacherei.de/…). Would be great to have you there.
@Gordon No, I do not remember that.
@Gordon Not as embarassing as the first time Stefan Priebsch met me. Which I also do not remember.
 
:)
 
2:32 PM
@Gordon It's fine. You have been nothing but an embarrassment in here anyway.
 
@PeeHaa thanks to you.I learned from the best :)
 
\o/
I am useful
 
no, you are not
 
oh :(
 
!!booze oban 14 years
see… not working… not useful
 
2:34 PM
Does that thing have a search api?
 
and dont pretend you have real work again
 
@ThW Funny screenshot from the other night: twitter.com/__aranthil/status/835935649630924801
 
Or does it have to be a exact match?
 
actually I retract that comment about predicting what it would become ...
 
@PeeHaa it has a search box but I didnt find any api. so it's probaby scraping.
 
2:35 PM
I couldn't have known when I started to write code for php that it would take up big parts of every day ...
 
@JoeWatkins I doubt that anyone could have predicted back in 2001 that I would be signing lots of MacBooks in Taiwan in 2016 ...
 
I don't mind scraping like a sagave
 
ThW
@SebastianBergmann hehe, no raids for me. Don't have enough time.
 
@SebastianBergmann yeah, you're right ... also, that's cool
 
ThW
@SebastianBergmann I will have to check. Not good timing :-)
 
2:38 PM
@Tarun not really, not touched front end for ages, not anxious to do it again any time soon...
 
@PraveenKumar thank you man!
 
oooooh Happy birthday @AdilIlhan \o/
8
 
@DaveRandom everything that happens on the client side is disgusting, and wrong ...
yes, happy birthday :cake:
 
You post something useful on Twitter and almost nobody likes/retweets/whatever. You post something funny on Twitter and everybody goes crazy.
 
2:42 PM
@SebastianBergmann I can relate
 
sound bites work well within the limits of twitter ... genuinely interesting/useful things, not so much
 
@Gordon when did you ever post anything funny?
/ducks
 
I tried to respond to the guy who tried to blame all programming mistakes on C the other day ... couldn't do it in 140 chars, and then the response was pretty much ignored
 
@PeeHaa thank you PeeHaa :)
 
he didn't really try to blame all programming mistakes on C, came up with some soundbite about it being bad in the 60s, 70s and during heartbleed so why bother with C ...
 
2:49 PM
anything simular to extentImage when running PHP 5.6.3 ?
 
ignorance, C makes the world go round ... it's programmers and their practices that are dangerous ... not the languages they use ... that's like saying if it weren't for English there would have been no world wars ...
 
@JoeWatkins Nein, nein, nein. It's so much nein it's almost ten. Everyone knows that if everyone spoke German then there would be no world wars.
 
Last cloudflare leak
Guess what C
 
@SebastianBergmann LOL
 
Your point is invalid and you should feel bad with your c
 
2:50 PM
@DaveRandom back in the beginning on my twitter career. Before I decided to move all that to FB
 
Nobody needs c
 
you know the majority of your operating system is written in C or a derivative of it, right ?
 
yes, and it sucks.
 
Nope wrong. Butterflies and javascript
 
hehe
 
2:52 PM
!!annoy daverandom
 
@DaveRandom @DaveRandom @DaveRandom @DaveRandom @DaveRandom @DaveRandom @DaveRandom @DaveRandom @DaveRandom @DaveRandom @DaveRandom @DaveRandom @DaveRandom @DaveRandom @DaveRandom @DaveRandom @DaveRandom @DaveRandom @DaveRandom
 
but seriously, I wouldn't want to be on the team with these people who think that the language they use can save them from doing their job properly ...
 
:P
 
Anonymous
hehe
 
6 messages moved to Trash
 
Anonymous
2:53 PM
!!ban peehaa
 
@samayo I'm sorry Dave, I'm afraid I can't do that
1 message moved to Trash
 
/me is afk, grumbling about how under-appreciated C is, and doing school run
 
lol
 
our grumpy deep C creature
 
@SebastianBergmann dunno… at least I won't know much ahead of time whether I'll have time or not.
 
Anonymous
2:56 PM
@Gordon lol
 
/me has no github notifications for the first time in weeks \o/
having actually read them all
oooh new opengrok release
 
Anonymous
I bet as soon as I submit a PR you disappear again.
 
Actually I still haven't reviewed !!mute
 
@DaveRandom async-twitter -> opengrok <3
 
@PeeHaa What did you end up using for that?
Not my twitter client?
 
2:58 PM
@PeeHaa ah right
 
@Jimbo It involves blackjack and hookers
 
@Jimbo no it's a fresh impl because (somewhat) decoupled async API
 
Good*
So you're saying this can handle the streaming api then
 
Yes thanks to sir @DaveRandom
 
\Amp\wait($result = $apiClient->request($request));
Then what? You have to use then() or a promise?
 
3:00 PM
@JayIsTooCommon did you say would would write us a little web front-end for lxr?
 
Still need to rewrite it at least once to make it a proper dave and pee coop though :P
 
@Jimbo Nope. That's the result
 
while (null !== $status = yield $stream->read())
Fml :-)
 
Well you could do while ($status = yield $stream->read()) really
 
Anonymous
3:01 PM
@DaveRandom lxr has a front-end oO ?
 
@JayIsTooCommon I mean to let us add projects
 
Anonymous
also any front-end I do will involve bootstrap... just a pre-warning
 
Anonymous
@bwoebi inb4 abuse
 
user895378
@DaveRandom Unless the stream read returns a one byte string of "0"
 
user895378
Because PHP \o/
 
3:02 PM
@JayIsTooCommon hm?
 
user895378
morning
 
@JayIsTooCommon Don't worry, I'm exactly the same
 
@rdlowrey in this particular case they are always objects returned, it's quite a high-level API
 
Anonymous
@Jimbo \o/
 
("stream" in this context is a twitter API "stream")
 
Anonymous
3:03 PM
@DaveRandom if you let me know the spec, I can have a dabble
 
@JayIsTooCommon The difficult bit is I would like it work in such a way that a) you login with SE OAuth b) it only lets ROs log in
As in, it checks whether you are an RO at login time
I also want that for Jeeves...
 
Anonymous
Wouldn't be easier to build this into the Jeeves?
 
Well it needs an app running on the opengrok back-end boxes
so whatever we did it would need a decent auth system
even for jeeves to talk to it
@PeeHaa you wanna mergificate the media upload stuff? Again it's not structly finished but it does work and you seem to be doing a load of other stuff, would rather it didn't get too far out of sync and become unmergable. Up to you though.
 
user895378
@DaveRandom jackpot
 
@DaveRandom I am mostly adding more requests, but considering it's not a v1 for a while yet I can live with mergificating all them things
 
3:14 PM
mrnrnng
 
mrnrnng
 
Anonymous
@rdlowrey o/
 
Anonymous
morhpaul
 
Anonymous
@DaveRandom that sounds.. fun.
 
3:51 PM
\o
 
yojoe
 
Morning.
 
yovi
 
hello every one
 
4:07 PM
hi
 
4:36 PM
@PeeHaa After our little chat, I don't think there's any need to...
 
h
hi
 
@FélixGagnon-Grenier youtube.com/watch?v=sl8q3Y2JASs .. this is just a beautiful fragment
 
5:08 PM
E vening room
 
I'm too lazy to try this out right now so I was hoping someone already knows the answer. If I've a got a composer package which is not tagged yet dev-master and I'm developing an application which uses this package would running a composer update package continually get the newest version of the package even though the version looks the same to composer since it is just dev-master. Yes I know it is not good to depend on packages which are under development but I own it
And eventually it will be tagged with a release and the project will depend on the released version before it goes live
 
yes, it'll pick up any changes
 
@PaulCrovella So if I make a new commit to the package, commit and push it and then run composer update package-name it will download the package with the newest commit?
 
5:24 PM
You don't tag dev-master
 
@Leigh I did not mean I tagged anything dev-master
I said If I have a composer package that is not tagged
A non tagged one being dev-master
 
> a composer package which is not tagged yet dev-master
Ambiguous at best
shrug
 
Jesus christ what is it with the elitism here. Anytime I ask something or see anyone else ask something they get hit with a wall of people who think they are so elite. I even had to add in at the end of the message that I know I shouldn't depend on a dev-master package...etc just so I wouldn't get 10 replies with everyone freaking out that I'm depending on a dev package
Could you not infer from me saying "not tagged yet" and "dev-master" that my package is not tagged with anything. Especially since a non tagged package automatically has that name.
 
Oh, now I really want to help.
 
@ibanore two people responded to you, one of whom was unclear about your question (because it is phrased unclearly). that's not a wall of elitism, calm the fuck down.
 
5:43 PM
No, he's right, I'm an elitist jerk, I just come here to look down on people who could have answered their own questions by spending 2 minutes testing exactly what they asked :)
 
@PaulCrovella I cleared it up and then he had to add in the "Ambiguous at best" and then a "shrug" for good measure. If you don't see elitism going on in this chat room then you are either blind or part of the problem. I am rarely in this chat room and usually when I am I see the people who consider themselves above the rest shitting on people all the time. It's like the grammar nazis except with code.
 
CachingIterator somewhat misses the mark... just like so many things in the standard library...
 
@ibanore I see leigh pointing out exactly what the cause of confusion was. That's pretty far from any kind of elitism. I think you're reading into things and getting yourself worked up.
 
@PaulCrovella Yes, this is minor. But to think there is no elitism going on in this chat room is absolutely ridiculous. Anyways, thanks for your help.
 
Lol salty
@ibanore maaaaaybe just maaaaaybe the problem is actually you
¯\_(ツ)_/ ¯
 
5:55 PM
@PeeHaa holy shit, you managed to do that without missing an arm on the first try
 
Ikr \o/
And on mobile even
 
so yeh, now everyone knows it's your fault, you'd better get on with it
 
Heheheh
 
why does it need an admin interface?
 
Probably so I don't have to bug chris for adding projects
 
6:00 PM
^ that
Just a simple UI for adding projects without having to ssh on to the box
also potentially some monitoring tools, since it's not the most reliable application/server in the world
 
@ibanore not sure about elitism, but some circle jerking for sure. but aren't all internet groups just that ?
 
minor: We are investigating issues serving web hooks as well as assets on GitHub.com as of 2017-02-28T18:00:27Z
 
set up a github project that's just a list of projects and have people submit PRs to add things, a hook can add them. big fat UI with built-in submission queue done.
 
Go for it :p
 
Morning
 
6:05 PM
Ohai
 
Morning all, anyone have any recommendation for what cloud service to use for simple image cdn? Client wants to load images fast in dubai and the west coast of US. Amazon? Akamai?
 
@PaulCrovella OK fine but I'm leaving that page up.
@JayIsTooCommon if you do decide to mess about with something, github.com/Room-11/lxr-admin-ui
/me makes pancakes
 
@Darius not sure how many CDN's have a POP location In Dubai.. if you can afford akamai go for it
 
kk
 
6:25 PM
Gn all .
 
o/
 
S3 is down !
 
working fine here
 
I'm extremely elite #justsayin
 
6:36 PM
when I take a piss, what comes out is also elite ...
 
is it the color of l33t ?
 
definitely
 
that might not be piss
 
@Vamsi you're a circular jerk ...
actually this is quite a healthy environment, we disagree and argue about it all the time ... all, the, time ...
 
lol @ circular
 
6:39 PM
for instance, I think @PeeHaa is a prick, and he doesn't think he's a prick ... see, disagreement ...
 
even @PeeHaa thinks @PeeHaa is a prick
 
:P
 
not helping to prove my point there @Paul ... but at least you are arguing ...
 
which means I am helping
^ me helping more
 
you can stop arguing now, it's pissing me off
/me goes back to jerking @Paul off, because that's what you do in a circle jerk
 
6:41 PM
I had to convience management to move all avatars to S3 and now its down just after a week we migrated ..
 
@PaulCrovella don't talk, you're ruining it ...
 
hehehe
 
I actually used foreach ($iterable as list($key, $value)) today.
 
I'm old fashioned and just use real servers, so I'm unaffected by s3 ... I'm very happy right now ...
@LeviMorrison isn't the structure of your data bad, and shouldn't you feel bad about it ?
if I've misunderstood what that does, then your code is bad, and you should feel bad about that ... I think ...
either way, you should feel bad ...
 
6:47 PM
final
class CountedIteratorAggregate implements \Countable, \IteratorAggregate {

	private $storage;

	public
	function __construct(\Iterator $iterable) {
		foreach ($iterable as $key => $value) {
			$this->storage[] = [$key, $value];
		}
	}

	public
	function count(): int {
		return \count($this->storage);
	}

	public
	function getIterator(): \Iterator {
		foreach ($this->storage as list($key, $value)) {
			yield $key => $value;
		}
	}

}
Yes, I feel really bad that PHP doesn't have built-in interfaces to cover this nor does it have intersection types to make this unnecessary.
 
I thought it was something like that structure, but I can see what you're doing thar ...
 
ThW
@LeviMorrison why the foreach() and not iterator_to_array()?
 
@ThW Because of potentially duplicate keys.
 
ThW
ahh I see
 
I'm not sure what we could do to unions and intersections to revive it
keeps coming up though
 
6:49 PM
Countable & iterable is very common.
And introducing a CountableTraversable interface isn't helpful since no existing will implement it.
(plus it alienates arrays when it doesn't have to)
 
and we should think very carefully before adding more specific interfaces or pseudo unions
 
Agreed.
I ran out of editing time to try to correct my mis-correction >.<
 
we need to find a way to revive unions, and or intersections ... probably and ... but really no idea how to make it please internals ...
 
Maybe if we ship type aliases along with it?
type CountableTraversable = \Countable & \Iterator;

function a_more_memory_efficient_sort(CountableTraversable $iterable);
 

« first day (2327 days earlier)      last day (2621 days later) »