« first day (4633 days earlier)      last day (540 days later) » 

00:09
interface I1 { function m1() { /* default method */ } }
interface I2 extends I1 { function m1(): SomeType; }
Should the above be an error? I think it probably ought to be, and it currently is, but the error message doesn't make particular sense.
> Cannot make non abstract method %s::%s() abstract in class %s
That is indeed a shitty error message
00:46
It would now say:
> Cannot make non abstract method %s::%s() abstract in interface %s
However, the more I think about it, the more it shouldn't error at compile/inheritance time. If today the code looks like this:
interface I1 { function m1(); }
interface I2 extends I1 { function m1(): SomeType; }
Then adding a default shouldn't suddenly cause an error.
 
8 hours later…
08:18
@LeviMorrison If abstract method has different signature than its default implementation, means default implementation expects more specific arguments and returns more broad value than extending interface provides. To make this sensible I'd add rule: If default method implementation is extended by abstract method and signature is different, then default method implementation is not used for that abstract method.
class Bar {}
class Foo extends Bar { public function fooMethod() { return 'blue'; } }
interface I1 { function m1(Foo $foo) : mixed { return $foo->fooMethod(); } }
interface I2 extends I1 { function m1(Bar $foo) : SomeType; }
class Test implements I2 {}
(new Test)->m1(new Bar); // what error and when will be emitted?
 
4 hours later…
11:57
@LeviMorrison I haven't fully thought around the LSP implications around default implementations, but in theory adding a return type (i.e. co-variance) should be fine.
@Krzysiek Yeah, well basically making a call to one of the implementation checks function in zend_inheritance.c
12:32
For some reason I cannot get this room to load unless I view in an incognito window... even after clearing my cache and cookies.
@Tpojka That's crazy...
13:34
Hah, tell.
14:22
Why isn't the PHP parallel lib moved into the core? Seems like it would be very useful
14:38
Morning
15:07
@SalOrozco o/
\o
o/
we'll have Interface default methods in PHP 8.3? I know it's in RFCs
Property hooks would be super helpful, that's in RFC as well
15:28
speaking of 8.3... is php-src master still the 8.3 or is there a specific tag already?
 
1 hour later…
16:28
@Ekin Still master, branch of happens for RC1 nowadays
cool, thanks
16:58
@Krzysiek I don't think we need to detect changed signature at all. If someone has specified the method, even with the same signature for some reason, then don't apply the default. cc @Girgias
@SagarNaliyapara Assuming it passes. There seems to be a lot of negative sentiment online about it. "Why not use traits?" I mean... traits don't have any contract nor relationships. Interfaces do. So that's why I'd use traits. But my point is tons of people seem to have this view.
At the same time, others are looking forward to it. So... we'll just see how it ends up in the vote.
I'm doing my best to get it done before feature freeze.
17:27
Hi. It's been ages since I logged in here. This chat used to be so much active.
Yes, but it's still a good place to be ^_^
Cool. I have not done php since 5.6. :) I can't wait to see how much the language has evolved.
A lot. Like, a lot.
That's cool. I hope for the better. It was getting pretty descent. Has expressions been introduced? I used to mentioned that they will be very useful especially for ORMs.
What do you mean by expressions?
(I think they're almost all good changes, but I am biased.)
17:40
Me being a C# dev, I mean the same as they are in C# (from functional standpoint). So basically it's very similar to anonymous function you pass in as an argument, however, instead of evaluating it and calling as a function, you get an AST of the passed in function giving you a nice way to transform it into SQL.
E.g. $users->find(function(User $user) use($passedInUsername) { return $user->firstname === $passedInUserName; })
Find function received a class of expression that gives access to the AST of the anon function giving you control to translate the return $user->firstname === $passedInUserName; to where u.firstname = @username)
This is a very high-level idea. Obviously, I know that php does not have AST at runtime, however, I think it's doable with some tweaking
 
1 hour later…
18:54
6 hours ago, by Statik Stasis
For some reason I cannot get this room to load unless I view in an incognito window... even after clearing my cache and cookies.
This was because of the Chrome extension "DuckDuckGo Privacy Essentials" that was blocking the chat room from loading. Just an FYI in case anyone else runs into the issue.
19:09
@LeviMorrison Fair enough. I've added signature part, but after some thought it's another inconsistency.
19:42
@Leri Ah, no, nothing remotely like that. You can pass closures and anonymous classes around as you like, but you don't get an AST of anything.

« first day (4633 days earlier)      last day (540 days later) »