« first day (3806 days earlier)      last day (1142 days later) » 
00:00 - 20:0020:00 - 00:00

cmb
12:20 AM
@IMSoP I think it's better to leave that to the ecosystem. To my knowledge, there are phan, phstan and psalm, and each might cater best to the needs of a particular codebase. And generally, php-src already already has maintenance issues; we shouldn't bite off more than what we can chew.
 
Hired this kid to do a graphic for me on Upwork. All he did was take an example and photoshopped the face on it lol
 
 
1 hour later…
1:39 AM
SSL_read on shutdown, ftp/proc_open ・ FTP related ・ #80879
 
2:20 AM
SSL_read on shutdown, ftp/proc_open ・ FTP related ・ #80880
 
3:03 AM
@JoeWatkins Happy birthday!! ;)
 
 
1 hour later…
4:29 AM
what did I miss here ? this chat is beautiful as you all !
 
 
4 hours later…
8:51 AM
@cmb oh, I totally get that there are practical problems with bundling a static analyser, maybe even insurmountable ones; but we're adding more and more type checks at run-time that really don't belong there
 
@Dharman Congrats on pushing something without deleting the repo :P
 
@Dharman thanks for patching my bug.
 
9:24 AM
@NikiC Regarding the internal method return type thread: I'd like to answer Nicolas' mail and I'm curious about your insights. Especially if his suggestion (storing the types in the attribute) is feasible to implement at all - without introducing much complexity. It doesn't seem so for me, but you are better informed than me. ^^
 
@MateKocsis Well, anything is feasible, but I certainly think it's not a good idea
 
yeah, I agree. Thanks!
 
10:20 AM
How is today Thursday already
 
@Tiffany Time
 
10:33 AM
@Tiffany shhh, don't let Tuesday hear
 
\o
 
@NikiC it doesn't feel like Thursday yet >.< I don't want it to be Thursday yet
 
@Tiffany Are Thursdays ... bad?
 
Nah, just trying to get something done at work, it's taking me longer than I expected, and I thought I would be closer by Thursday to having it near completed.
 
10:42 AM
So today is your Curseday
 
Kinda. I wouldn't go so far as to call it a curse, but time has been moving faster this week than what it feels like
 
Are you working as a developer now?
 
Yup, PHP developer :D
 
My deepest condolences
 
?
I love what I do, and I'm gaining experience (and confidence) as a developer, and getting paid for it
 
10:50 AM
Well if you love it, then that's what matters
 
Only thing I wish I could change is our build environment, but I can work within it
 
For me programming (as a career) was the least enjoyable thing I ever did
Are you using a framework?
 
Programming is not without frustrations, but it's something I've enjoyed doing my entire life. It's hard to imagine me in a different career field. I probably could be a technical writer, but I dunno...
@samayo nope
 
@samayo You should not do what you don't like
 
If technical writing was a person, I would marry it. I never thought I would have a job that I love, like ever...
 
10:54 AM
life advice
not even career
 
Do what makes you happy, as long as it doesn't harm another person. Preferably another being, but it's hard for me to give up meat-eating. :S
 
I love programing, but as a career? nope! All bugs, errors, bad libraries, system compatibilities ... all of this and you are forced to deliver a product ... it's madness.
 
The problem is that the advice requires a lot of balls
 
It's the career I hate, but programing is awesome
 
@ln-s balls as in... chutzpah? Or something else?
 
10:57 AM
Balls as in courage
 
Does no one else here worry when you are not able to fix a bug but you have to deliver a product in a certain time? How do you cope with that?
That was the issue for me. The more I worry, the harder it became to find a solution and eventually time runs out
 
@samayo I ask my boss or coworkers for help
 
@samayo Simple: do not take jobs with hard deadlines for your product :-D
 
^ and that
I've had bugfixes or products I need to release at a deadline, but I'm assigned problems I can solve. If I struggle, coworkers and my boss help me out.
 
good advice
 
11:01 AM
Having a supportive team makes a huge difference, I find
 
An excellent indicator for lousy jobs is
checking the git history, taking the first and last commit date difference
by author
so you see how many people have laid hands on the project and for how long they were at said job
the more people you have on a short span of time, the lousier the job
clearly an indicator of a cluster fuck
Plus a good technical job does not requires HR bait such as fruit or a healthy breakfast or super fun things to do
 
11:17 AM
open_basedir crashes Apache ・ Safe Mode/open_basedir ・ #80881
 
11:34 AM
morns
@samayo I just cry in the corner :P
 
Hey, how to use firebase push notification in CodeIgniter? Please suggest.
 
@samayo At that point it's a business problem, as they sold a product that didn't exist.
 
12:20 PM
Morning all
@Danack This is epic! =D
 
12:42 PM
@PeeHaa Are you playing Valheim now?
 
@StatikStasis but not good enough for an grammy nomination apparently...
 
@IluTov high five
 
Looks like wordpress people are starting to use transpiling to be able to use some features of PHP8 while still having libraries usable on lower versions.
 
@Crell \o :)
 
12:51 PM
@Danack That's horrifying.
 
@Crell why?
 
@StatikStasis Nope :)
 
Tiffany thought you may have started playing... you should.
 
It's an effective engineering solution, but it does feel somewhat like giving a safety blanket to a person in a building that's falling down around them.
 
@PeeHaa could've sworn it was you talking about it... I have names wrong I guess
 
12:56 PM
@Danack Honestly not too bad. That would mean that library authors can start using new PHP features (or some, at least) without dropping support for older PHP versions. While you should only support maintained PHP versions IMO, it still takes multiple years before such features can be used.
 
Oooh, it was @FélixGagnon-Grenier
 
I mean, it works pretty well for JavaScript. If that technique became more common it might even be possible to transpile a more strictly typed version of PHP to normal PHP (pretty much what Hack does).
 
@Tiffany Felix suggested me to play it
 
yeah. JS started needing transpiling way earlier, so their ecosystem for it is widespread and 'normal' for them.
 
@Danack It was more necessary for them because browsers were out of their control. But given we're reaching some technical limits with our current approach (generics) exploring this idea might be worth it.
 
1:00 PM
Unrelated, is there a way to indicate to PHPStorm/users that a trait can only be used within a specific class? (context is I'm writing a trait for use within PHPUnit tests, so it can only be used within the Test class).
 
It would be really nice to create a superset of PHP with all kinds of native types, compile it down to PHP with Psalm annotations, and then analyse and run that code. I actually wanted to do that for a while, but since it's unlikely to succeed I never did.
 
@StatikStasis I've heard you really want some mods when playing
 
@Danack class_exists?
Err, not that one
Let me find it
 
So, phpstorm doesn't give that error.....
 
@Danack No, the only thing you can do is add abstract methods to your trait, if that helps. But other than that there's no way to restrict a trait to a certain scope.
 
1:04 PM
@Danack class_uses?
 
@Tiffany It's the inappropriate error message phpstorm is showing me that I want to get rid of.
 
@Danack Oh wait, does this help? freek.dev/1482-the-mixin-php-docblock
 
@Danack I was thinking of a check using class_uses, but I may have the thought process backwards
 
I find the prevalence of precompile/transpiling in Javascript to be a sign of weakness in the language and ecosystem, not strength. Precompiling to a high-level interpreted language is just a ridiculous concept.
If you're going to require a compile step, at least use it to front load actual work and compile to Wasm, or bytecode/opcodes, or something.
 
Transpiling in JS was when I became more interested in back-end dev...
 
1:07 PM
@IluTov WINRAR!
 
I agree, transpiling feel slike it's part of the "it works" manifesto a lousy excuse to not do things right
 
There's a commit strip that explains it pretty well but I haven't been able to find it in awhile
 
@Crell "to be a sign of weakness" so? It's not like we don't know everything is shit already.
 
@Danack This is one of the reasons we know it is. :-)
 
@Danack Who is we ?
 
1:12 PM
People who have written code?
 
@ln-s waves in general at the state of the planet
 
@Crell Why is it ridiculous? And there's always the possibility of taking the concept further compiling to opcodes directly.
 
Isn't one suposed to use poly fills for that kind of stuff
 
@ln-s they aren't possible in PHP for anything related to syntax changes.
 
@ln-s What kind of stuff? You can't use polyfills for syntactic changes.
 
1:17 PM
@bwoebi I'm really enjoying the base game as is. It's still new so I'm sure there is more to come. Mods will just make it even better... but I can see myself spending many hours on this game, just in building.
 
The computer executes low-level code. The point of high level code is to make it more human friendly and expressive, and then translate it to low-level code for the computer. That can be done in one step (C, Rust) or several (Java, Go, PHP), but there's always a degree of "do a static analysis pass, verify that it's correct, now get closer to the metal in the knowledge that we've already verified or optimized a certain part" benefit from doing so.

That lets you break up the static analysis and translation process into multiple steps, for various reasons and benefits.
 
@Crell My clients refuse to allow me to hold people at gunpoint until they upgrade their browser.
 
Then that is the problem to address. :-)
 
@Crell If your superset is an even higher-level language you clearly get a pre-compute benefit. Type checking at runtime is expensive.
 
Does opcache strip out type checks if it can verify them ahead of time? Or is that back to being a problem with not knowing which class would be used until runtime.
 
1:21 PM
If the top level language is a DSL, I could buy that argument. Compiling a DSL to an interpreted language that can then get executed or compiled all together has its advantages.
 
cmb
The point is that "nobody" is still willing to write ES5, but IE11 "needs" to be supported.
 
"needs"
 
In many cases it's corporate policy. I had to battle for years to get to throw IE11 overboard.
 
@MarkR It doesn't. The main problem with optimization at the moment (without preloading, not sure how much different it is there) is that each file is regarded as a separate compilation unit. The main benefit here is that when files you're depending on change you don't have to recompile the current file. The downside is that nothing is certain, and any class that you're referencing might or might not exist, might or might not have certain methods with a certain signature.
So optimization is limited to the given file.
 
I was looking for if we had a dev mode vs production mode flag that we could change behaviour on (I was going to add checks for array type on set classmap only in a dev mode) but the closest thing we have is assert.

Such a flag could be used with the same considerations as preload re: not changing without a restart or full purge.
 
1:33 PM
@MarkR Apart from that, even when it would technically be possible, types are still verified. 3v4l.org/mN9O8/vld#output VERIFY_RETURN_TYPE in Foo::baz could safely be removed I think.
 
@IluTov It looks like all the return type checks could be eliminated in that example.
 
@MarkR I think it is in bar (the VERIFY_RETURN_TYPE belongs to the implicit null return).
 
Ah good call.
But back to the point-o-hand, I could see something doing static analysis and stripping off the type check ahead of time as a transpile stage.
 
@IluTov Works if bar is explicitly marked final, heh
 
@MarkR That is basically the only hope we have of getting generics, it seems. :-)
 
1:46 PM
posted on March 18, 2021

 
Ah, because of inheritance overwriting the public method, interesting.
@Crell That or throwing 100k at it to do nothing for a year but generics
 
@MarkR When Nikita says "geez, this is hard", I figure I should run screaming. :-)
@MarkR Inheritance overriding the public is the root problem of so many social ills...
 
@MarkR Since PHP 8 we should be able to use non-final return types as well
I'll look into it
 
It would presumably error out at the linker / inheritance checks if it tried to return anything other than int, or narrower?
 
2:04 PM
@Tiffany yeah :) it's pretty kewl
 
@NikiC It actually works locally, I think the opcodes shown by 3v4l are not optimized.
Oh no, sorry, it doesn't.
Regardless, 3v4l seem to be unoptimized, e.g. the implicit return is correctly removed.
 
2:29 PM
Exception::getPrevious and Throwable::getPrevious may return NULL ・ Documentation problem ・ #80882
 
@Jeeves Low hanging fruit if anyone wants to do a docs PR ^
 
@LeviMorrison In fact, there is a PR for this which is generated from the stubs: github.com/php/doc-en/pull/168/…
 
3:42 PM
@MateKocsis That's cool!
 
3:53 PM
@IluTov Turned out to be a pretty big rabbit hole
 
4:22 PM
@NikiC Hard to fix?
 
cmb
@NikiC if that helps, you should really consider this. I have no objections. IMO that was a bad idea in the first place.
 
5:24 PM
@IluTov I discovered some side quests... Ended up fixing github.com/php/php-src/commit/… first
 
@IluTov did you have a look at the grammar for the intersection type or not yet?
 
Side Quests, Breaking Your Workflow Since PHP3™
 
@cmb No longer relevant for that particular problem, but I did see the large number of related bugs you recently had to deal with...
Seems like a pretty big footgun
 
cmb
yes, it is, although it seems to me that before PHP 7.4 it wasn't as bad as it's now (OTOH, cache_id usually helps)
 
@cmb Any idea what changed in 7.4?
 
cmb
5:33 PM
not really, but if I had to guess, I'd say something related to preloading
 
Assertion failure in Zend/zend_hash.c:731 ・ hash related ・ #80883
 
6:20 PM
@Girgias No, but from Nikitas description it was clear what the problem is. We could do some ugly stuff in the lexer but I'm not sure if that's acceptable.
 
Wonder if changing it to a GLR parser would do the trick
 
@Girgias Yeah, that would do it. But if we do it now I want better arrow functions!
 
@IluTov Weren't there more problems than just the parsing issue?
Also wasn't there a risk for more branches being created as arrays are very common? Whereas there it should fail pretty fast
might be telliing non sense I don't know parsers
But currently still stuck on the variance code, where currently I'm stuck on "I don't need to perform 4 loops do I????"
 
@Girgias Yeah, that's an ambiguity. Hack uses ==> to disambiguate. But apart from the operator it requires arbitrary lookahead.
 
SoapVar optional parameter types depend on PHP version ・ Documentation problem ・ #80884
 
6:34 PM
so, a bit late but I just read this article about someone with "null" on their license plate getting plenty of problems and I am relatively confused. how can that actually create a problem?
 
@NikiC I remember from one of your talks that a lot of int optimizations are blocked by the fact that arithmetic ops convert ints to floats on overflows. Is this behavior still useful now that we have type hints and nobody actually handles this case? E.g. function add(int $l, int $r): int, it doubt many people will make it return int|float.
 
afaik sql can't confuse is null and = 'null'.
 
Also, it's super weird that 3.141 gets coerced to 3 but PHP_INT_MAX + 1 errors, IMO.
 
@IluTov Have you seen my RFC...
 
I mean, ok, PHP_INT_MAX + 1 has no int representation, but I honestly thought 3.141 -> int would type error.
@Girgias Which one? Maybe I just forgot.
 
@Girgias Awesome!
 
Also do you want more funzies with float to int
(int) "1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" will give you INT_MAX but (int) 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 will give you 0
 
The number of times floor() has TypeError'd on me because of silly casting rules :(
 
Oh boy
 
6:47 PM
@Girgias I'll have a look at your grammar now and create a POC. But it's not gonna be pretty :P
 
Have fun :p
I'm currently debating bewteen going back to the variance code, or trying to refactor the SAPI API
 
It is my firm belief that at some point Girgias is going to find some odd combination of numbers that, when cast to another type, somehow executes the number, in binary -> ascii form, inside an eval.
At which point someone will complain that removing it is a BC break O_O
 
At this point I shall burn that person's house
 
I guess the test/s for casts needs more cases
 
Well not really (int) INF == 0 is kinda known
 
6:59 PM
Would expect that (int) 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 is INT MAX
 
I don't understand this opcode line:
> 4 1 ASSIGN !1, 1.0e+129
how come it's written as scientific notation. does PHP lose the significance of it at some point?
 
@FélixGagnon-Grenier floating point numbers have a limited range, at which point it becomes INF
 
<?php var_dump((int)9e99);
int(0)

<?php var_dump((string)9e99);
string(7) "9.0E+99"

cool
so it formats the number better when casting it to string ?
<?php var_dump((int)"9e99");

int(9223372036854775807)
yet (int)9e99 is 0 :)
 
7:20 PM
static function flattenSpecSection($section, $withKey='validation') {
	$buffer = [];
	foreach($section as $inputName => $specs) {
		$buffer[$inputName] = $specs[$withKey];
	}
	return $buffer;
}
There has to be a more elegant way to do that
 
@Shea array_map?
 
Yes I think that's what I was looking for, thank you
 
to me it would be more elegant with type hints, the scope of the method appears to be public and there are no checks that $sepcs[$withKey] even exists
+ array map
 
Maybe not array_map because I still need the keys
@ln-s oh yeah that's gonna blow up eventually huh? I need to validate key exists
 
yes absolutely
also validate that the type of said key is the type that you expect
 
7:26 PM
@Shea It will keep the keys
 
For every array that you use, there's probably a class you could create that can handle that data structure in a more correct and elegant fasion
 
> hints
 
@ln-s bah I'd just implement ArrayAccess to keep that hacky feeling ;)
 
Example, interface SectionInterface { public function getValidations() : ValidationCollection; }
@FélixGagnon-Grenier Naughty :P
 
7:30 PM
@Girgias github.com/php/php-src/commit/… Various tests are failing but I think that's form your variance check changes.
 
array_map(fn ($specs) => isset($specs['validation']) ? $specs['validation'] : '', $section);
Perfect, thanks guys
 
@ln-s at this point, PHP has a type system, no hinting required. Parameter types, return types...you want types, we got types.
 
$validator = new Validator();
$validation = $validator->make(self::$saved, self::flattenSpecSection($section, 'validation'));
$validation->setAliases(self::flattenSpecSection($section, 'caption'));
$validation->validate();
That use to look a lot worse
 
@Tiffany sometimes I use "typehint" to talk about the actual type system.
 
I was about to say
 
7:38 PM
@FélixGagnon-Grenier specify what kind of type then :P
e.g. "you should add a parameter type"
Sorry, needed clarity
 
I wonder if my autocomplete in VS Code would work better if I did more type hinting?
 
I'm not a vscode user but I've seen that it does
 
s'all good @Tiffany :)
 
@Shea so you are restoring validators from a json file or whatever?
 
@Shea array_map(fn ($specs) => $specs['validation'] ?? '', $section);
 
7:42 PM
I'm generating a form from an array of form specification and picking out the validation requirements for each input after it has been submitted
 
@PeeHaa Wouldn't that show a warning if the validation index does not exists in $specs
 
No it would not
 
I need to rtfm one of these days, I'm missing a lot of good stuff
 
Ok so the null coallescing operator removes warnings, seems inconsistent to me at least
 
So the parser doesn't immediately generate a warning the instance $specs['validation'] doesn't exist, and it actually looks head of operators first?
 
7:47 PM
It just doesn't generates a warning
 
Iirc we'd want to suppress it with an @?
 
<?php

$specs = [];
var_dump($specs['validation'], $specs['validation'] ?? 'woot');
@ is evil, I'm just saying it should show a warning
 
@IluTov Yeah there is one which is marked XFAIL as it has union and intersection but then the other ones in the variance folder can fail because hand waving
 
@ln-s o.O
 
the ?? is functionnally equivalent to isset($a['key']) ? $a['key'] : 'default' I believe.
not sure why this should show a warning ^
 
7:50 PM
Well I don't control the language it's actually whatever you guys want it's good to now that I don't have to check for array keys existence when using ??
 
But it's that's right then the parser looks ahead for the operator instead of consistently reading left to right?
 
@IluTov But anyway thank you :D it might be ugly but if it works I'll take it :D
 
@FélixGagnon-Grenier indeed
 
@Girgias One note, Bison warns when two tokens have the same description. Not sure if we can suppress that. That why I changed the second one to &'
 
@PeeHaa What's up with the eyes, I didn't get it, why the surprise ?
 
7:52 PM
@IluTov Was going to ask about that, but I'll leave that for later lol
 
I guess that makes sense because the statement isn't really done until , ) or ;
 
Also, ask @NikiC if it's acceptable, but I see no other way other than switching to GLR mode.
And as mentioned, this does have a BC break. You can no longer add comments between & and the parameter variable $foo, but that's probably not too big a deal.
 
@ln-s It literally replaces isset() in those cases so saying it is inconsistent is a bit weird :)
 
I see what you mean, I just always wait for warnings
@PeeHaa thanks
 
warning-based development ;)
 
7:56 PM
careful development ? :P
 
Hey this is the PHP room. GET OUT!
 
Good one
 
Warnings and notices in your logs means the code is running!
 
"kind of"
 
... that's actually not the worse advice you ever said @PeeHaa
 
7:57 PM
is there a plan to remove include ?
I really prefer require instead of include and I think include is dirty
Probably not I guess
 
Wat
That's a dumb statement, include and require are for different things
 
@IluTov I think so. Overflowing to floats still makes more sense than wrapping around
Though bigints would be a better fit of course
 
00:00 - 20:0020:00 - 00:00

« first day (3806 days earlier)      last day (1142 days later) »