« first day (1587 days earlier)      last day (3358 days later) » 

7:26 PM
I'll never use "by design" again
 
PHP is an imperfect language by design =)
 
@rdlowrey @bwoebi Here we go: github.com/php/php-src/pull/1096
 
@NikiC we expose the generator This when var_dump()'ing it. Could we expose it's return value too (from the moment on where it exists)?
 
@bwoebi We do? I don't remember generators implementing debug info
 
...
...
No we don't well… Closures do, but gens don't. Sorry.
My bad.
@NikiC github.com/php/php-src/pull/1096/… what type of Exception is that? A basic Exception? I'd maybe use RuntimeException for this?
 
7:41 PM
Yes, it's a basic Exception (same that is thrown for rewind())
RuntimeException requires SPL dependence
 
s/by design/intentionally
 
Or throwing RuntimeException when SPL is available and Exception otherwise, which is very ugly imho
 
oh, well… true… core shouldn't depend on anything but ext/standard…
 
just make SPL required
 
@NikiC agree.
 
7:42 PM
actually right now I'm not sure, isn't spl required?
 
It is
 
I've just seen this pattern of throwing different exceptions based on spl, so assumed
 
it's not been always required
few years
 
It is… since 5.3?
 
Okay, in that case that leaves us with the question ... why should this be a RuntimeException?
Shouldn't it be a LogicException? :P
Whoever implemented SPL exceptions was definitely trolling us ;)
 
7:44 PM
hehe
IIRC it was Marcus
 
:-D
@NikiC and before you relax about your great work now ( thanks! ) … what about yield *?
(btw. I'd throw an EngineException if that RFC already were voted on…)
 
@bwoebi I wouldn't ... because it looks like they will be outside the hierarchy
 
@NikiC honestly, I think those exceptions should be brought into ext/standard
 
@ircmaxell I think reasonable exceptions should be brought into Zend/ ;)
but not the SPL exceptions
 
7:56 PM
@NikiC You think? :s
 
@bwoebi I think I'll make it a voting option
 
so, we always need two catch blocks for our catch all handlers? (or update them for the superclass??)
 
Oh, re: typed exceptions in engine exceptions. I think things like invalid types (passing stdclass to bar hint) should be a dedicated exception
 
@bwoebi or catch BaseException (if php 7 only code)
@ircmaxell write it to the list ^^
including a nice name, what it inherits and why this particular exception type should be split off
 
@NikiC what will you put to vote? subclass to Exception or subclass to BaseException?
 
7:59 PM
@bwoebi it will be a separate vote, whether it should be a subclass of that or that
@bwoebi I'll take a look
 
yeah, I meant, what the voting options are…
 
@bwoebi yes
 
@NikiC does the RFC have a list of errors it targets?
 
@ircmaxell nope
@ircmaxell List of errors can be found by scrolling through github.com/php/php-src/pull/1095, which seems to be the current patch ^^
 
ah cool, will do after I send the apology mail to Zeev
sent
news.php.net/php.internals/83235 <-- that should hopefully do it
3
 
8:11 PM
it's nice when we're all grown up
 
now, what's the next piece of drama I need to start slinging mud at?
 
and when there's cake ... I prefer cake actually ...
@ircmaxell I see you're settling into internals in the normal way :D
 
:-P
 
@JoeWatkins looks like the zero cost assert RFC already passed easily :D
15:0
 
no reason not to pass it
 
8:19 PM
yeah… but too many people vote for the wrong option…
 
@marcio maybe, apparently >85 people haven't voted though ...
 
=D
 
:) let the mass vote for the next scalar type hints RFC, maybe the record will be beaten
@NikiC Hey, speaking about "no reasons not to pass" something we only need 8 votes to pass group use declarations... still one week to end the voting 30:19
@bwoebi still no dice on putting your yes vote back?
 
wrong RFC
 
@JoeWatkins They'll all come around on the last day and vote NO ;)
 
8:26 PM
@marcio well… it anyway doesn't have a chance to pass I think.
 
yay, hopefully that hatchet is burried
 
@bwoebi well, it can get closer, just a neutral twit from @Sara made a huge diff few days ago. Thanks Sara.
Grouped namespace use expressions. Read it, vote on it: https://wiki.php.net/rfc/group_use_declarations
 
@marcio done
 
@bwoebi I am quite pleased the way wiki.php.net/rfc/date.timezone_warning_removal is going :)
 
@ircmaxell and look in the middle of the replies:
@mitchellvanw @SaraMG Sometimes I think that Sara and Andrea Faulds are the best things to happen to PHP.
 
8:30 PM
@NikiC Me too… but Really surprised by Andreas vote.
 
@bwoebi Thanks for doing the RFC :) We were all continuously bitching about it and you actually fixed it :)
 
@NikiC I'm really surprised at that
 
@ircmaxell hmm, why?
 
Just from the discussion prior to vote didn't seem to have that many supporters, yet alone sitting at > 2/3
 
@marcio The angel on my shoulder wants me to be neutral, The devil turns me into a salesman.
4
 
8:36 PM
@ircmaxell The discussion mainly were the few loud voices
 
i.e. Derick and Stas
 
Kinda sad that grouped use won't pass, but I'm not passionate enough about that to push it.
 
@bwoebi yes
 
Re datetime_warning, my inclination is to vote "No", but I'm going to abstain instead.
 
ummm, group_use's URL is really bad
 
user895378
8:38 PM
@NikiC nice, will build and play with it in a bit.
 
user895378
53 mins ago, by bwoebi
@NikiC and before you relax about your great work now ( thanks! ) … what about yield *?
 
user895378
^ @NikiC should I start working on an RFC for that or hold off for now?
 
@rdlowrey Well, you can draft the RFC now, then that's done at least :-)
 
@ircmaxell I'm bad to baptize RFCs, this might come with practice. Thanks for the vote :D
 
it's all good :-)
 
8:44 PM
Guys, apparently there is yet another scalar RFC "on the table"… can anyone point me at the right table?
 
Zeev's table.
 
@Narf Ze'ev's table ;)
 
@NikiC LOL, right :D
 
@rdlowrey Not sure ... it's a bit tricky to implement
 
8:49 PM
@tereško yeah, really bad
 
@ircmaxell I'd vote "yes" to that!
 
user895378
@NikiC I understand ... if you think you can make it work just let me know and I'll write up an RFC. If not, I still <3 you for doing the generator return patch. Thanks!
 
@salathe /me starts making the necessary arrangements...
 
@ircmaxell lately I have begun mentally keeping a "stupid company" list
 
@salathe with hookers... and declares
 
8:51 PM
it already contained "Samsung" (for the smart-tv thing)
 
@marcio declare(blackjack=1, hookers=1); ???
6
 
@NikiC that deserves an RFC
 
@salathe But in all seriousness, it's weak hints with a bit more lossless rules being the "compromise" with strict supporters.
 
@NikiC dat looks nicer than expected
 
@Narf Did you find the table?
 
8:54 PM
@salathe The table found me ;)
 
@Narf Ah, the table found you? Like this? ノ┬─┬ノ ︵ ( \o°o)\
@ircmaxell After how much you emphasized that you aren't trolling in reddit.com/r/PHP/comments/2wgqkm/… I started seriously wondering if maybe you're trolling?
 
@NikiC Maybe, not sure ... I never liked ASCII art and that's even less expressive :>
 
user895378
In Soviet Russia, table flips you.
 
^ Not surprised there is an ASCII art representation for that already.
 
@NikiC I really wasn't trolling. I know some languages are spec-first, but considering Hack doesn't appear to be being built that way, I think it's an honest question
 
9:00 PM
Apparently Hack just got a language specification: hhvm.com/blog/8537/announcing-a-specification-for-hack
 
@bwoebi @NikiC @JoeWatkins @ircmaxell Just a heads up for guys that seemed interested on the semi-reserved words RFC: After some careful deliberation I made a little effort and expanded support to namespaces, classes, interfaces and traits names.

RFC: https://wiki.php.net/rfc/context_sensitive_lexer
TLDR patch: https://github.com/marcioAlmada/php-src/commit/77225b8f5d60146c6575e95ebfca2196bf3953a1
Full patch with tests and all the things: https://github.com/php/php-src/pull/1054/files
I'm currently working on the additional typehints support which is sort of broken right now. The bug seems easy to fix so the intention is to put the RFC into discussion on Monday. I'll leave it here to be scrutinized while I expand the draft RFC with more information.
 
23,252 Zend/zend_language_scanner.c View
19,407 additions, 3,845 deletions not shown
So many :o
 
@marcio RFC looks good
 
@bwoebi is this an issue? It's all generated code.
 
no… I just was surprised…
 
9:08 PM
@bwoebi I suspect the added lookahead generates significant complexity
 
possibly. Is there any perf difference @marcio ?
 
very good question
 
The RFC says no, but it does not say how this was measured
 
@bwoebi I couldn't notice any diff, I'll have to make a serious benchmark at some point though.
 
@marcio Did you perform dedicated lexing performance tests?
 
9:10 PM
@NikiC I added an entire library inside an if(false) statement and run it like 100.000 times.
 
@marcio k
 
@marcio perhaps write a sapi which just stresses the parser (that way you remove more noise)?
 
@ircmaxell indeed, I noticed the diff for the generated file increased after the lookahead macro was defined. But it might not be the only reason.
 
sure, and that's not always a bad thing, so look forward to seeing structured results :-D
 
@marcio I think you could do with a better example: class Collection { function list() {} }
Also, a typo: delcare :)
Other than that, I fucking love it :)
 
9:14 PM
@Narf please, if you have more better user space examples add it to a gist and I'll put it in the RFC by the weekend.
 
@ircmaxell I'd say token_get_all() gives enough approximation for measuring differences @marcio
 
@bwoebi perhaps, yeah that seems reasonable
 
@marcio Nah, just this one example ... I often want to use list() as a method name.
But I'll tell you if I think of something else of course.
 
@marcio Typo in the extends/include example.
That is, it says extends in the comments, but is include in the code.
 
@bwoebi token_get_all() spends the vast majority of time creating arrays, not tokenizing ;)
 
9:17 PM
@NikiC I know. But differences of 1% in lexer time are measurable.
 
user895378
> Scalar Type Hints v42.34.18
 
=)
 
user895378
^ Apparently we're using Federation star-dates for RFC versioning these days.
 
@rdlowrey forgot the "HIKE"
 
Still better than Chrome. ;)
 
user895378
9:19 PM
lol
 
user895378
v42.34.18OmahaOmaha
 
@bwoebi I preview memory exploding if I do the same tests with token_get_all, but I'll give it a try.
@rdlowrey v42.34.18.NaN.NaN
 
at least building the array should be much faster than compiling and parsing…
 
@rdlowrey I already see the "PHP is a web-oriented language" replies ...
 
user895378
-________-
 
9:23 PM
Hi everybody, I came here earlier to ask how to throw error on ajax call with wordpress. Someone point me to Exceptions and return proper http header, but I was wondering wich number http error number do I have to return?
 
@JonathanLafleur Choose wisely - but basically; 4xx the client did something wrong, 5xx the server did something wrong.
 
Thank you ! I'll look at this, but I just found wp_json_send_error()
 
@rdlowrey I think you should adjust the wording around exceptions. If an exception is thrown the generator is no longer valid
 
@NikiC is return populated in that case?
 
9:35 PM
@ircmaxell no
 
but it's also not an error, correct?
 
it is an error
accessing the return value of a generator that has thrown, that is
 
how do you know? ->valid() is false, but ->getReturn() throws an error?
doesn't that seem a bit...odd?
 
no
In the applications this is targeting, if the coroutine throws it means it must be unscheduled (and the exception forwarded to where the coroutine was "called" from). Accessing the return value in that case is a bug
 
@marcio moving the section "The proposed change, if approved, also gives more freedom to userland fluent interfaces or DSL like APIs." to right near the start, might be a good thing. It's a more powerful argument for the RFC than the first couple of pages (imo). Also the text "but currently fails because 'extends' is a globally reserved word" may be in the wrong section? There is no extends.
 
9:38 PM
@NikiC yes, but shouldn't there be some mechanism to detect that in the generator?
 
@ircmaxell I don't think that it would be useful
 
hasReturn() which does both ->valid() and thrown checks?
 
@ircmaxell You can just catch the exception if you really need to know this
 
fair enough
 
function hasReturn(Generator $gen) {
    try {
        $gen->getReturn();
        return true;
    } catch (Exception $e) {
        return false;
    }
}
> 1. Argument Mismatch (not passing required parameter, passing invalid
parameter, etc)
2. Parse Error (eval, etc) - note this appears to be implemented already
3. Methods On Non-Objects (call to a member function on null)
4. Call to undefined method (this should be a separate exception from ^^^)
@ircmaxell ^-- and should all of these not caught by default as well?
 
9:42 PM
I would assume so
I'd love to reuse InvalidArgumentException for the first one, but...
 
In other news, we now officially have a revenge RFC. :D
 
@Danack thanks, fixing... you should be the official room11 RFC reviewer, BTW
 
@ircmaxell And why should these in particular be subclassed?
btw, right now ParseException inherits from BaseException not EngineException
 
@NikiC what's the inheritance order?
 
@marcio you guys would need to use simpler words for some of the RFCs.....(possibly not actually a bad idea...).
 
9:45 PM
BaseException (abstarct)
 +- EngineException
 +- ParaseException
 +- Exception
     +-ErrorException
     +- all other exceptions
copied from dmitry's mail
 
@NikiC because they are things that commonly are runtime-based errors, and as such are more common to be pivoted on
so ParseException isn't an EngineException? interesting
(not that that matters)
 
user895378
@NikiC updated.
 
@NikiC or to write that another way, I have code that I could restructure if I had the ability to catch only those specific classes
 
Uh, yet another RFC…
 
user895378
YAR!
 
9:54 PM
oh, I found the April 1 RFC
 
Then YAR from @kelunik, then YAR from @rdlowrey and then probably YAR from Zeev in the next days… phew…
 
the tabs/spaces switch for scalar types
 
Weren't you looking for something believable? :)
 
user895378
Should I announce a yield from RFC in the next three days in the hopes that someone can get a working implementation done in the next two weeks for a vote and inclusion in 7?
 
user895378
/cc @NikiC @bwoebi ^
 
user895378
9:58 PM
And just not worry about it if not?
 
you can… I won't be able to work on anything before Monday… but Nikita may…
 
@rdlowrey which would what? proxy to an inner generator?
 
poooh, writing RFCs is far too much like hard work :/
 
user895378
@ircmaxell yes. Essentially. It's not required, but it makes writing asynchronous code that feels synchronous easier.
 
user895378
Pulling directly from the relevant python docs:
 
user895378
10:08 PM
> The main principle driving this change is to allow even generators that are designed to be used with the send and throw methods to be split into multiple subgenerators as easily as a single large function can be split into multiple subfunctions.
 
can you give me an example of what that would look like?
 
user895378
sure ...
 
@NikiC Just yesterday I was told off for suggesting a base Object :P
 
Something something we could just use an interface....but apparently it's already been implemented.
 
@Danack properties
 
10:11 PM
@ircmaxell Yeah. I still don't get that. People who extend Exception can still do so. Where's the issue lie?
 
@DaveRandom I have create an alias to a local mailbox, which is just a forward to the external address :P
 
what if an extension wants to extend EngineException?
 
Good for it?
 
well, but having BaseException be a class, the property system can be common among all exceptions, rather than having to implement them specifically on each side
 
That's what always what I think - I know I can share this code amongst these classes to save retyping it....and then 3 months later I realise that they're actually separate things.
 
user895378
10:14 PM
@ircmaxell So here's a real-world example of how yield from would be used in my http server:
 
user895378
function myHttpResponder($req, $res) {
    // execution resumes when the promise returned from myAsyncCall()
    // is resolved successfully and the result is stored in $a
    $a = yield myAsyncCall();

    // $d gets the return value $c from the nested generator
    $d = yield from myNestedGenerator();
    $res->setStatus(200);
    $res->send("<html>hello world: {$d}</html>");
}

function myNestedGenerator($a) {
    $b = yield mySecondaryAsyncCall();
    $c = yield myTertiaryAsyncCall($b);
    return $c;
 
@marcio it's OK bro, I'll remember who implemented it :)
 
@rdlowrey then $d would be equal to $c from "myNestedGenerator"?
 
user895378
@ircmaxell yep
 
interesting
seems reasonable
 
user895378
10:15 PM
It basically allows you to treat the yielded things in the nested generator as if they were in the parent.
 
user895378
(as opposed to what I have to do currently -- convert each individual generator into a promise and resolve it individually to get its eventual result)
 
user895378
So I already have the capability now, but adding yield from would simplify it and make it faster.
 
user895378
This was added to Python in 3.3: docs.python.org/3/whatsnew/3.3.html#pep-380
 
and make it easier to understand in the middle layers
 
user895378
And it's a thing in ES6 via yield *
 
10:18 PM
@Leigh wat? oh no, I only cited the twit because it is a true.
 
@marcio s'ok, bro :)
 
So, I hear you like RFCs, but I hope this doesn't need one: github.com/narfbg/php-src/commit/…
Can anybody tell? Is it a good idea at all?
 
can a RFC be put to vote like one day before the feature freeze? I still have 2 RFCs to finish xD
 
@rdlowrey my ridiculous "lets write crypto in PHP" senses are tingling, a generator to yield blocks and a return value for a MAC that is updated on the way.... off to the laboratory!
 
user895378
@Narf Without having looked at what it actually does, I would say a new function in an existing extension like that could be handled with a PR and not a full-blown RFC.
 
10:21 PM
@marcio It always can, but they'll probably tell you to target the next release :D
 
user895378
@Leigh Speaking of, what shook out with random_*() has that happened yet? If not I think we need to do an RFC in the next three days.
 
Well that probably depends on the complexity of the change
 
@rdlowrey Great, thanks.
 
user895378
@Narf but you'll want to do your PR with the accompanying explanation in the PR message sooner rather than later.
 
@rdlowrey grumble, trying to coax @SammyK along, but he seems pretty busy. If he hasn't found time by the weekend, I'm just going to PR everything I think needs doing to his branch
 
10:23 PM
@rdlowrey Yes, of course ...
 
I've done a ton of research, and have a much better understanding of my ideal now
I'm basically planning on stealing some of libressl-portable
 
user895378
@Leigh works for me :)
 
@rdlowrey The thing I'm wondering about here is why the "async calls" aren't also using yield from
 
Not sure we'd need to RFC the functions themselves, they are all self-contained and non-breaking. However, if we want to apply the CSPRNGs to stuff like session_id generation, or propose the deprecation of mcrypt_create_iv at the same time, I think we'd have to RFC it
 
user895378
@NikiC they could if those calls were generators. But with my particular "framework" any time I yield a Promise instance the server knows not to resume execution until the promise resolves (if successful). If it fails then the exception is thrown back to the generator.
 
10:27 PM
@rdlowrey k, guess it depends on the details of how one wants to implement async calls
 
user895378
Yeah it does.
 
@Narf update it for 7 (using zend_string)
 
@ircmaxell zend_string on what exactly? It's based on master and I took hash_pbkdf2() as an example to follow, I'm not really familiar with the zend_* stuff
 
oh, ok, thanks
 
10:34 PM
@ircmaxell is there any gain in this function to use zend_string*?
 
user895378
@NikiC My coroutine resolution is pretty similar to how it's usually done in javascript land: I just yield promises whose underlying async operations are all resolved using the same underlying non-blocking event loop. That way the event loop lib acts as the task scheduler for everything. When promises resolve in some future tick of the event loop the generator from which they were yielded is resumed.
 
@bwoebi clarity.
that's the only one I can think of
 
@ircmaxell And the disadvantage is not using stack memory but using a pointer.
 
Phew, busy day.
 
@bwoebi which is happening anyway, no?
 
10:36 PM
Have I missed any comments or discussion on Comparable getting proposed?
 
@ircmaxell yeah. Just that's all in the same memory region then.
 
49 mins ago, by bwoebi
Uh, yet another RFC…
@bwoebi I think the only difference is code clarity (putting the lengths and values together)
 
@bwoebi it will just be an offset'd read
 
@ircmaxell but I'd rather not discuss that now. I don't know enough about how caching is affected in such situations...
 
@bwoebi fair enough, but I think new functions should be built using it unless there's a compelling reason not to
 
10:40 PM
(There's nothing worse than discussing things when the other one has absolutely no idea what he's talking about…)
 
@ircmaxell Maybe reconsider block mode for declare. Frameworks like Symfony generate a bootstrap cache file: http://symfony.com/doc/master/book/performance.html#use-bootstrap-files
 
user895378
Best reason evah!
 
valid point.
But you also just can make two files… one with the strict and one with the weak code…
 
@bwoebi complex inheritance relationships may prevent that
 
Anyone have any strong feelings against encapsulation?
 
10:44 PM
true
 
@Leigh ?
 
@ircmaxell like, private classes
 
-1
 
Is that all you have to say on the matter? :)
 
no, I've just said it a number of times
I'd rather see a first-class module system
instead of a hack on string comparison
 
10:46 PM
Well, I guess we'd all rather see a lot of things compared to what we've got :/
 
no, to the point that I think "private classes" really are useless when someone can "fake" the namespace trivially from outside
inner classes? sure
 
Yes obviously you can inject yourself into the namespace, but I see it as more of a "hey, you shouldn't be doing that" tool
 
@NikiC @LeviMorrison @bwoebi what do you think about that block-mode use-case (generated files)? Would that look like namespace block mode? Where no code is allowed outside of declare blocks?
@Leigh first class modules please
 
Is this the appropriate time to announce I quit? :)
Oh well, it's something I was working on before christmas, and someone else came up with a more mature implementation than mine, but I've written the RFC for it, guess we'll see what everyone else thinks
 
go for it
 
10:50 PM
@Leigh is this about the Guilherme Blanco's pull request?
 
@marcio yerp
 
@Leigh I saw the PR some time ago, is it active again? wow, so many things getting aligned on the last corner to PHP7
 
@marcio Yea he was working on it a lot without pushing
 
@ircmaxell I think, our aim is to prevent users from switching all the time. While we won't be able to enforce no switching in global scope files… who uses global scope apart for small tests? I think this is acceptable.
 
Couple of bits still missing, but it's pretty complete (includes reflection etc.)
 
10:56 PM
oh I see, just a bugfix missing according to him.
 
and clone according to me :p
not sure if that requires any special thought
 
clone? I don't think so... should we be disallowed to clone instances of private classes when we shouldn't even have access to the instances in the first place?
 
@bwoebi cool. Thanks
 
@Leigh The main thing it was missing is that it does EG(scope) based checking, which does not work outside of classes
 

« first day (1587 days earlier)      last day (3358 days later) »