« first day (4248 days earlier)      last day (925 days later) » 

06:55
@MarkR I'm going out walking today, cause it's going to be rain all weekend.
 
5 hours later…
11:47
but it's working tho 🤔
11:59
@Crell I definitely want to put the RFC forward soon. I want to try to address some feedbacks first
@ramsey zend_update_property does addref, so it has rc=2 ... so yes, either set rc=0 before update (Z_SET_REFCOUNT) or release after update (zval_dtor) ...
12:32
o/ Happy Friday
13:09
morning all
can anyone help me solving this error psalm.dev/r/bb26e9b757
am struggling with it for over an hour already
Ok I think I've solved it
/**
 * @template T of object
 */
class ResultPage
almost always when I send a question I figure out answers by myself
:P
13:24
it's always like that
13:41
Yep
 
1 hour later…
14:50
happy friday indeed \o/
Indeed. Start a vacation when I'm done with work today.
That's all good. I love the feeling prior to going on vacation.
Yea, it is a break between job changes. Planning on spending some time with my wife, hanging out with my nephews, and trying not to write code :P
I'll probably fail at the last part but I'm gonna give it a try
15:19
=D
15:59
> Prototype Pollution in async
16:49
Can we have generics, please...
Working with psalm and phpstorm in order to work and properly detect types is a nightmare.
:(
o/
If generics are supported in PHP, you would have to use some kind of static analyzer to get much benefit from it, then you would end up with the task of working with psalm and phpstorm :)
Psalm/PHPStan/PHPStorm would most benefit from a native generics syntax. Especially, in Psalm/PHPStan it is not possible to specify type parameter during instantiation of function call because there is no syntax for it. So Psalm/PHPStan need to rely entirely on parameter inference.
*instantiation or function call
This is a problem in expressions like new Collection(). The analyzer has nothing to infer the type parameters here. If PHP had generics natively we could write new Collection<int>() in this case.
17:30
Since PHP-Parser can retrieve the preceding comment at each node, including function call expressions and new's class name specification, I think it would be in principle possible to deal with it in Psalm or PHPStan if someone could come up with a syntax.
It would definitely be easier to read and write with native support, though.
What if we added a List/Sequence type that had its own custom generics syntax? That's like, half the use cases for generics right there. Or would that be more work than adding it to everything?
Psalm and Phpstan support annotations like /** @var Collection<int> $collection */, but it's inelegant
Inline @var should be exterminated as it effectively disables type checking :P
Exactly, I'd love an alternative.
Unfortunately if I want to type a generic, manual declaration is generally the only option.
Yeah, it's unavoidable sometimes......
17:57
It comes up a lot in amphp code, for example: https://github.com/amphp/websocket/blob/v2/src/Rfc6455Client.php#L24-L40
The Future and DeferredFuture props are generic as well, but I didn't bother adding the type because it's void and unused.
Annotating properties is a little nicer than inline @var
@var for properties are not guilty!
It just hurts my eyes a little bit.
Property types should make that unnecessary, and yet there they are.
If we all continue to pray for native generics every day, the energy may summon native generics to this world through some occult effect.
18:14
@sj-i yes! assert() is a good alternative except for generics
@Crell That would help, but then we need generic functions to work with these generic collections :D
@sj-i I want to work on that some day
@ArnaudLeBlanc This also works, but yeah it's too much boilerplates. psalm.dev/r/4fbf2312ef
@ArnaudLeBlanc great!
Oh, on second thought, this still works psalm.dev/r/35763f23da
A little less boilerplate, yet not so natural though. I continue with the summoning ritual.
18:36
Is there no-op reorganization or front-work that could be done to move in that direction? Nikita said it was a crapton of work, but is it work that has to be done all at once, or can we leverage "Make the change easy (this may be hard) and then make the easy change"?
@Crell you should probably ask Nikic directly but this reads to me like it needs someone to plob down enough money for someone to work on it for multiple months at least, without even any guarantee of even finding how progress could be made.
Yeesh.
(Hence why I keep trying to think of "40% benefits for 20% effort" approaches.)
18:54
@Crell we can definitely make a lot of ground work without changing the language, but I don't know if merging this change before an RFC is accepted is a good idea
How does the build system know to regen the file pdo_dbh_arginfo.h from the stub pdo_dbh.stub.php ? I'm trying to add another stub for a new that will need to be generated also.
@ArnaudLeBlanc Why not? If we know it improves the codebase, and makes future improvements easier, that seems a lot better than trying to fight with merge conflicts for the next 3 years.
@Danack I think that the Makefile rule %_arginfo.h: %.stub.php will run if the .php is more recent than the .h
@Crell Oh I see. Yes we should try to do that
19:50
Even if it's a net-neutral change, as long as it doesn't make things worse but builds toward a feature we know is widely desired, I think that's fine.
The odds of a working generics RFC not passing, as long as it doesn't absolutely destroy performance, are basically zero.
20:13
Does this seem wrong to anyone else? 3v4l.org/HYQbF - I'd want the middle one to behave like the 3rd, not the 1st.
@Crell I agree
It... looks like array addition is actually doing what I want. 3v4l.org/M6Fdv - I did not expect that.
 
3 hours later…
@Danack hrmm... I wasn't aware of flossbank before this. Too bad, the concept for what they were trying to do sounds really beneficial
But, I could also see where it would be incredibly challenging
For the reasons they mentioned plus I would imagine many others
yeah. just not the right strategy from the start.
Talking of which........does anyone actually use preloading, and is it worth setting up?
rather than doing something boring like setting up your autoloader, then iterating over all the source files in your src directory and just require'ing them?
@Danack I've used it in production since it came out. It's handy to have especially if you've got a build step where you can spend a bit more time creating a custom set of includes.
@MarkR If you don't do that, how long does it take for PHP to warm up with all files caches by opcache anyway?
23:11
it's a fairly minor difference, I think it was something like 10 to 15% or so, the main thing is it doesn't have to run all the class definition opcodes / linkers like when using normal opcache
More benefit with more code included each request naturally
So you see a performance difference per request, even after everything is warmed up?
Yes, normal opcache only eliminates the parsing and opcode generation step on the next request, it still has to replay all of those opcodes each request. Preloading loads its state, with all that code / structure already in memory, and retains it between requests, therefore no need to re-run the opcodes
cool.

« first day (4248 days earlier)      last day (925 days later) »