« first day (3813 days earlier)      last day (1135 days later) » 
00:00 - 16:0016:00 - 23:00

12:02 AM
@Crell Hi, for the auto capture closures RFC, did you guys consider the option of using a keyword like: $cb = auto function() { ... }; (similar to how we have static closures). Whenever I see fn in the examples, I see it as an alias of the function keyword
 
12:12 AM
@Kalle We didn't, as that introduces a new keyword and a whole lot of additional questions about what it does and in what context. auto-what, exactly? Also, a big part of both RFCs is "less typing". So adding more keywords is counter to that goal.
@MarkR Can you post on the list with a more complete example of that code that we can clone into the RFC? There is a clear desire for more concrete examples. :-)
 
@Crell I get that, but I don't think it would be an issue if we just made fn an alias of function in all other contexts
 
That would also be a much bigger change. :-)
 
I think of the fn() as auto capturing, and the => as the return expression result
 
I just find the implicit behavior magical as it is very unlike everything else in PHP and the determining factor is just a shorter keyword that symbolizes the same thing
 
@MarkR Oh, wait, you did already. :-) May I steal that for the RFC?
 
12:15 AM
@Crell Steal what?
 
Your code sample with a bunch of use'd vars.
 
@Kalle as a standalone statement this seems very sensible
 
@Crell Don't see why not. It was just to build up an email message
 
Thanks.
 
@DaveRandom I think so too, just not a fan of the keywords having different semantics like that, but I guess that is personal bias :>
 
12:20 AM
I would be fine with it if there had been a way to get rid of the keyword completely for short syntax
I understand why that was not possible, but in lieu of that we may as well adopt the shorter keyword to make e.g. method signatures a little tiny bit more readble
every little helps :-P
and conversely, there's no reason not to permit the long version in the same places if you really wanna do that
imho, ymmv, etc
 
While I think most of what Rowan said was besides the point, I think the one good thing he brought up was that JS and its multiline closures does allow using let to define a new scoped var.
 
it would also be more intuitive if we were to allow expression method shorthand decls
 
Disgusted as I am to say that JS of all things does something better than PHP
 
like public fn getFoo(): int => $this->foo;
 
Yes, that's the short-functions RFC. :-)
Sadly a fair number of people are still meh on it.
 
12:26 AM
it's fine, they are wrong
and will be proved so
:-P
on that note I need to sleep, nn x
 
I hope so. :-) I don't want to count my chickens before they vote.
 
g'nite Dave
 
 
9 hours later…
9:28 AM
VirtualProtect error when proc_open executed in CLI ・ JIT ・ #80905
 
10:03 AM
Hi everyone! I'm probably just being daft, but I'm getting a compile failure on PHP < 7.3: gist.github.com/alcaeus/0becdf8a1c5fb52408521a01e34a24ed. The offending line uses ZEND_STRL within a call to zend_hash_str_add. I saw that the latter is a macro on PHP < 7.3, but I'd think this should work regardless. Could someone please enlighten me as to what I'm not getting?
 
cmb
10:27 AM
@alcaeus if zend_hash_str_add is resolved before ZEND_STRL, you have too few arguments. Better don't use ZEND_STRL at all.
 
@Crell I say if we want short functions it should definitely be with the fn keyword. It doesn't make sense to shorten it but not all the way IMO.
But yeah, I think I fall into the "meh" category :P
 
11:01 AM
PSR-20 is a clock?
 
it sounds weird, but imho it is a useful thing to standardize
@PatrickAllaert hey ho! happy to see your release manager candidature
 
11:43 AM
@cmb that explains things, but it's unfortunate since it makes the code a little easier to handle
 
12:02 PM
Hey @beberlei. Yes, I'm very excited about it :-)
 
12:22 PM
Morning, all.
 
Does instanceof triggers autoload ?
 
12:45 PM
yes
hm, no
 
interesting
 
No it doesn't because if your object has been instantiated, he would have had triggered the autoloading before, whether it's a class, interface,...
 
$array = [ new SomeObject(), new SomeOtherObject()] ;

foreach($array as $obj) { var_dump($obj instanceof SomeInterface); }
 
If SomeObject or SomeOtherObject are using SomeInterface (directly or indirectly), it would have been autoloaded at the first line.
If if hasn't been autoloaded because it wouldn't be used, then instanceof can answer "false" without even bothering autoloading it.
 
let's say none of those have implemented SomeInterface
$a = [new \stdClass()];

foreach($a as $o) var_dump($a instanceof MyInterface);
nothing happens ok
 
1:02 PM
every $o in $a would have already loaded MyInterface if its instanceof.
 
exactly, false
 
"instanceof IntrefaceWithATypo" is a nasty kind of bug to track when you are not using a static analyzer (like phan)
 
Yep
so is it better to ensure that the interface really exists before doing such things ?
From a usable perspective I would say yes
to avoid exactly what you said
 
I would say no, use a static analyzer ;)
because a static analyzer will also catch errors like:

if (/*totally unexpected thing and hard to unit test*/) {
throw new RuntimeEcxeption("<== See the typo?");
}
 
1:08 PM
Static Analyze ALL THE THINGS
 
Sure thing
But for this case in particular when I have a filterByInterface method, I prefer to tell my user "Hey this doesn't exists" rather than having him bang his head against the desktop for hours being absolutely unproductive and then explaining to him "Hey use a static analyzer"
It's all about being friendly
 
and even checking the class/interface doesn't protect about typos:

if (interface_exists("MyInterface") && $object instanceof MyIntreface) { }
 
this will
phan is the preferred static analyzer ?
 
Officially, none are preferred. I quite client HackLang's static analyzer, but that doesn't help PHP much. :D
 
or phpstan
I imagined so, I'm just saying "what's more used out there" :)
 
1:15 PM
I think there's a lot of motion in the PHP static analysis ecosystem and you should do some exploration yourself.
 
I've been using phpstan for some time
 
((I don't write significant amounts of PHP, and haven't for a long while))
Then keep using it until it's no longer useful to you. :D
 
@Sara I recall that from your last pod cast for voices of the elephpant
I can absolutely understand it
As a car manufacturer can make a car but he doesn't drives it, other people do
 
Well, I imagine most car designers also drive.
Those not necessarily their own cars...
 
Maybe they prefer other cars
right
 
1:19 PM
Was talking a few days ago (maybe in here?) about how I used Google for my own searches while I worked on Yahoo's search product.
 
hahaha well
You don't have to wear the company's t-shirt
I mean
it's not YOUR company anyway
 
Largely because product managers insisted on having every shortcut and the kitchen sink on the page.
 
¯\_(ツ)_/¯
ah yes the make it better with bowties and confetti
 
"shortcut" meaning "Hey, you asked about the weather, so here's the weather in wherever your IP comes from" above the search results type of thing
Which in fairness, was usually a decently reliable guess about location.... usually...
 
I imagine those product managers as kids
playing make up
@Sara Do I also get the power ball numbers on screen ?
coz I'd like that
Next to the Jumping monkey gif please
But no so close to the bronco's game results from last night
 
1:25 PM
You joke, but I'm pretty sure that scores of major sporting events were one of the things.
 
haha I kind of figured it out!
Kids playing make up
 
I remember parts of my team being pulled away one year for a month to prepare a bunch of shit for March Madness.
Yeah, kids playing makeup is a good analogy.
 
I would dress like a girl and go straight to the product manager and start doing make up on her/him
Once I'm done
I would state loudly: THIS IS THE SAME SHIT THAT YOU DO TO THE SEARCH ENGINE
then proceed to remove my skirt and pony tail
and walk away
Then I would quit
(before they fire me)
They almost seem the same:


t.php - 0x7f276f6720a0 + 4 ops
L3 #0 NOP
L38 #1 INIT_FCALL 112 "test"
L38 #2 DO_FCALL
L39 #3 RETURN<-1> 1

t1.php - 0x7f2fe0c720a0 + 4 ops
L3 #0 NOP
L39 #1 INIT_FCALL 112 "test"
L39 #2 DO_FCALL
L40 #3 RETURN<-1> 1
First: https://3v4l.org/1AYgH
Second: https://3v4l.org/ZOKMl
 
The cross dressing seems a.... weird, and probably unnecessary detail to that exit strategy. Also, who's going to let you draw on their face while you're doing this?
 
@Sara Sorry didn't mention the glock into the equation
 
1:32 PM
Ah, now it checks out.
 
crossdressing might seem weird, however it sums up to the cringe effect
 
@ln-s The traces you're pasting ARE the same. The implementation of the test() function is what differs.
Though the compilations of those should match as well, due to the if (false) being elided.
 
The only difference I see are the L numbers
 
Crossdressing by itself is only weird in the fact that the word exists at all. It implies a strict alignment of clothing genders, which when you stop and think about it is really really dumb.
 
The point is that I wanted to see if there's a clear benefit from returning early
versus
huge if blocks
 
1:35 PM
The 'L' numbers are the line numbers.
They changed in the second one because you added lines.
 
gotcha
 
And you didn't return early...
So I'm not sure what you were testing.
 
People in my company tend to nest a bunch of crap
which is hideous
from a reading persepctive
the infamous hadouken if paradox
 
Oh yeah, no.... that's code smell
 
 
1:36 PM
@Sara You say that, but fishnet tights really don't give the support a man would need for day to day use.
 
Neither do boxer shorts, I assume, yet they seem popular.
 
@Sara So instead of doing that crap, I check what is needed to run, and if that doesn't complies, I just return or throw an exception, it does results in cleaner code, however I was wondering if it was in someway also more performant
And you can't hold pads with boxer shorts
Unless you buy boxers for a 5 year old
xD
they are supposed to slack you know
obvious reasons that I will not state
 
@ln-s Use non-constexpr tests when you're doing that. Our compiler is JUST smart enough to deal with const conditionals well.
 
Oh ok let's see
 
Curiously, in this example: https://gist.github.com/sgolemon/dc1fedffc33fcf25741396cb4737a088
We're marginally more efficient to do the if-haduken
That said, I'm going to caution against running with this.
The #1 concern here is code-readability.
Let the compiler worry about what's more efficient (and if necessary, preform transforms during compilation to MAKE it more efficient).
And ignore 'utf8-encode' in the path, that's literally just where I left my terminal last
 
1:47 PM
It's a parody...
 
@Sara yep
 
Note "Bosstown" not "Boston"
 
You from bosstown ?
 
Still... we're not far away from this particular dystopia
 
God damn what did IE do now? March patch has screwed up my website again. I know they are trying to make it more like Edge but jeez
 
1:48 PM
hahhaha the T-pose is a nice touch
 
@Sara Interesting example thank you
9 OP's vs 11 OP's
 
The number of ops isn't as interesting as what the ops do.
 
I don't know that much, can only speak of what I see :(
It is a bit strange that the hadouken if is more efficient tho
 
Actually, in this case, the ops are a fairly small variety, count might matter as much, largely the number they trace through.
Actually... rethinking about this. They're the same, aren't they? In both cases, not outputting a 5 requires failing either one or two conditional. Outputting it means passing two.
So the branching is the same, just inverted.
The trouble with contrived examples is that "example datum 1" starts to look a lot like "example datum 2"
My original statement stands though: Write what you won't hate maintaining a year later.
 
Yeah I live by that statement but I work with people who can not get their heads around just simply returning early so they if if if if all the time
I think they would be better off coding and solving mazes in paper
 
1:57 PM
I remember a chess program I wrote in '91 that had a massive haduken-if in the bishop handling function because I was too young and shit at my craft to make a decent algorithm out of it.

The image of that indentation chain still haunts me to this day.
 
base reasoning of multiple nested if's is just the same as solving a maze in paper, but hey you get to use crayons!
hahahaha
Question is if you remain a 12 year old or if you grow up
We have all done it
 
I'm pretty confident I could rewrite that function with about six lines today. Three, if I used Python.
 
What did you used back then
 
I was... cough older than 12...
 
GWBASIC ? QBASIC ?
 
1:59 PM
This was Turbo Pascal 4, iirc
GWBASIC was 80s era for me
 
When I was realy young (12 or so) I did GWBASIC
 
QBASIC I touched a couple times here and there around '90, but it didn't stick.
 
Stuff here came ages after it was out in the US
during late 80's / early 90's
 
My GWBASIC era was in Los Angeles at the Boys and Girls Club, so... probably 8 or 9?
I remember they taught us the concept of variables as "Imagine you're at the library and every drawer in the card catalog has a name, and in that drawer is a sentence.
 
It was only until 98 (maybe?) that whatever was released in the US was also available here
 
2:01 PM
session.use_cookies = false still require not sent headers ・ Session related ・ #80906
 
If you want to print out a variable, you open the drawer with the right name, then you read what's on the card inside.
So libraries were these places where we used to keep books.
Books are what we put stories in before tablets
 
Since I work with adults mostly I tell them, hey remember that weird shit from your math class x = 2? Well that's a variable, why is it variable? because you can change it's value to whatever you want then I do the same with functions, they get it
 
Man, I can picture that B&G club perfectly. Bizarre the things that survive in memory.
 
Then I immediately exemplify with a form (no code, just a form with a name)
@Sara indeed
 
@Sara Does the language, PHP/C/Rust for example, influences your habit of returning early?
 
2:07 PM
Then I would ask a coupple of people to write the name in the form
I think it's page 1 of the cautious person's manual to return early
 
@PatrickAllaert I want to say 'No', but I'm sat here trying to decide if that's true or not.
I probably don't use returns very often in LOGO....
 
I do, for every nested statement there's probably a cleaner way of doing it using early returns
@Sara I wonder if the parser has to "jump less" when returning early
 
I think that whether you are using a language which handles memory management automatically or not may slightly changes the habit. Also the reason why I use goto's much more in C than in PHP (thank you @Sara by the way ;-)).
 
@ln-s In the contrived example I gave, it's 50/50
I was going to mention a good RAII implementation possibly being influential, then I thought about where I use patterns like that and I actually still don't think it's 100% true.
Especially if you regard goto done; in C to do manual cleanup as equivalent to return; in C++ allowing the destructors to manage themselves.
 
hehehe
 
2:15 PM
Been thinking I should put just the last frame on a tee shirt.
 
hahaha
 
Nerds will get it, muggles will look at me funny.
Which is really the ideal outcome.
 
And it's not so corny as there are 10 types of people in the world
I second it
 
... I suddenly want a version of this comic where it's an Elephpant instead of a Velociraptor
Woof... Larry's new short functions thing is... kind of a hot thread on internals atm
 
monkey user is also cool
 
2:21 PM
Programming is such a well paid job, you'd have thought the pharma industry would have developed a pill that gets rid of programming-specific imposter syndrome.
 
google is probably paying big pharma not to, to suppress wages
 
@Sara ^ Sounds like you
 
Nonsense. I haven't used Skype in years.
 
2:38 PM
Bring back MSN messenger \o/
 
Loved it's unciphered protocol
and WEP fun times
 
Seg fault with pcntl_alarm() when triggered while waiting on IO ・ PCNTL related ・ #80907
 
@BrentRoose o/
 
Hi!
So, Aaron, I did change the line you mentioned but is didn't work unfortunately
I get these kinds of errors
/Users/brentroose/Dev/ext-fiber/boost/asm/make_arm_aapcs_macho_gas.S:45:5: error: unexpected token at start of statement
@ shift address in A1 to lower 16 byte boundary
^
/Users/brentroose/Dev/ext-fiber/boost/asm/make_arm_aapcs_macho_gas.S:46:9: error: invalid operand for instruction
bic a1, a1, #15
^
 
2:54 PM
Good memories with MSN messenger, and yahoo messenger.
 
@Sara Let me know if anything of value is said.
Too much noise, too little signal for me to actually read it.
 
@Danack I'm not sure why the Thai government would care about Catalonians wanting independence, or why a web petition site would bother them when there's literal riots in the streets. But I guess trying to understand the logic of politicians is a tough game even when they're legitimately elected.
 
@BrentRoose It's still using the arm file instead of the arm64 file even after changing those lines?
 
I've been hearing about the catalonian deal for quite some days, what is going on with catalonia ?
reading more likely
 
So I changed this

- [aarch64*], [fiber_cpu="arm64"],
+ [arm64*|aarch64*], [fiber_cpu="arm64"],

in config.m4
 
2:59 PM
You did run phpize --clean before attempting to build again, yes?
 
and ran phpize -clean
I did yea
It said "Cleaning.."
that was it
 
Huh, ok, then arm64 must be wrong.
@BrentRoose As a quick test, try making the next line [arm*], [fiber_cpu="arm64"]
 
Not sure if it helps but I get 19 such errors, all saying either "unexpected token at start of statement" or "invalid operand for instruction"
Sure, will test
 
I want to see if it works if it uses the 64-bit asm.
 
that works!
"Build complete.
Don't forget to run 'make test'."
I'll be honest I've got no idea what the changes I did just now actually meant, but I'm glad it works :p
Oh so my wife's home, I should get going, is there anything you need from me still?
so for reference, this did the trick:

- [aarch64*], [fiber_cpu="arm64"],
- [arm*], [fiber_cpu="arm"],
+ [arm64*|aarch64*], [fiber_cpu="arm64"],
+ [arm*], [fiber_cpu="arm64"]
 
3:05 PM
@BrentRoose If you have a few minutes, you can help me determine what the CPU is actually identifying as
 
@LeviMorrison Eff no. I'm not getting into that thread until it cools down.
 
Would love to be I need to get going :( I get up at 5 AM UTC+1 though, maybe you're still around in your timezone still?
 
@BrentRoose Simply add AC_MSG_ERROR(["Host CPU is {$host_cpu}"]) after the section you were editing.
Then run phpize --clean, phpize, and ./configure
It will error, but it will tell me what I need to change.
@BrentRoose Otherwise yes, I'll still be up at that time.
 
3:21 PM
@IluTov The problem is that right now, 'fn' is what implies "auto-capture." And for short functions there's nothing to capture.
 
@Crell So it's still auto-capturing, perfect :P
 
I fear that will be more confusing. Two changes to indicate one behavioral change.
 
Trying to avoid jumping into the threads, but I wanna offer thoughts on auto-capture in closures.
$capturesAllByValue = function() use(*) { ...};
$capturesAllByRef = function() use(&) { ... };

This is (close to) how C++ does auto capture. (C++ actually uses = for by-value, but I think * fits PHP better).
But basically, that makes it opt-in with minimal new syntax
 
@Sara Would reduce some typing, yes, but it's still a chunk of extra syntax that isn't really needed.
 
As to the argument about "BUT WHAT ABOUT GIANT CLOSURES?!?!?!" I think that's a strawman. Developers are, largely, responsible about how they use closures.
I disagree that it's not needed.
You're talking about adding new behavior, that should be opt-in.
 
3:35 PM
@Sara Agreed. People writing 500 line functions are not the target audience for this coding style. :-)
 
Overloading fn() { ... }; purely to save keystrokes is a step in the wrong direction IMO.
 
It is opt in? No existing multi-line code would be auto-capturing right now...
Porque?
 
@Crell I don't get why fn would imply that. fn was chosen simply because it was shorter.
 
^^ That, what @IluTov just said.
 
@IluTov Yes, but we're looking at the implications given the current syntax.
 
3:37 PM
Nobody coming into the feature is going to see fn and assume that means auto-capture.
But you see use(*) and the meaning is, if not entirely obvious, at least indicative of what to look up.
 
Someone yesterday suggested just making fn and function synonyms in all cases. I'm not sure I like that, but I suppose it's technically possible, probably.
 
fn() => expr is a shorthand sugar for function() use(*) { return expr; } IMO
 
@Sara Disagree. The only other place 'fn' is used right now has auto-capture. It's not unreasonable to assume that a second use of 'fn' is also going to auto-capture.
 
As a user, to me it's syntax sugar
 
You use the former to be concise, you use the latter to be clear.
@Crell But is that obvious? Answer: No.
 
3:39 PM
@Sara It's difficult for us to judge what will be "obvious" to arbitrary PHP developers of arbitrary skill level. :-) (Hardly specific to this issue, of course.)
The best we can do is ensure that the syntax implications are internally consistent, which I believe we've done.
 
I'd be equally happy to have function() use (...) as auto capture
 
There's two subtly different cases here. One is "I'm capturing a whole lot of variables and repeating them is annoying." For that, 'use(...)' or similar would get the job done. The other is "this is a short function within a short function, just not reducible to a single expression, I can't be arsed to deal with what is contextually obvious in every other language I use." 'use(*)' does not help there.
Stupid bad formatting...
(Though I am personally more interested in short functions than the auto-capture closures, but I support both.)
 
Maybe auto capture by default, unless you mess with use
 
That would be terribad
 
00:00 - 16:0016:00 - 23:00

« first day (3813 days earlier)      last day (1135 days later) »