Re: Draft RFC callable types + callable type/function autoloading
| From: | Stephen Reay | Date: | Thu, 21 May 2020 09:09:57 +0000 |
| Subject: | Re: Draft RFC callable types + callable type/function autoloading | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-110230@lists.php.net to get a copy of this message | ||
> On 20 May 2020, at 20:07, Dan Ackroyd <Danack@basereality.com> wrote:
>
> Hi internals,
>
> A while ago, I spent some time thinking about callables, and how they
> are not very consistent, which makes people sad:
> https://wiki.php.net/rfc/consistent_callables
>
> The reason I didn't pursue that RFC is that although tidying up PHP
> core to be more consistent would be nice, it would be a large amount
> of work, that wouldn't dramatically improve the developer experience
> when programming in PHP. In fact it would mostly just break otherwise
> working code.
>
> What would be better would be an RFC to make callables be more useful,
> specifically by allowing you to define the parameter and return types
> for them. Making it possible to autoload those types would be
> required, and function autoloading is also a feature that has been
> desired for a while.
>
> So here are two draft RFCs:
>
> Callable types
>
> https://github.com/Danack/FunctionTypes/blob/master/1_callable_type_rfc.md
>
> Function + callable type autoloading
>
> https://github.com/Danack/FunctionTypes/blob/master/2_autoloading_part_2.md
>
> I'll leave them on github for the moment, as it is easier to do PRs
> and track issues there but I wanted to gather initial feedback before
> getting closer to the RFC cutoff date.
>
> I'll move them to the wiki and formally submit them for discussion
> when the implementation is closer to being done.
>
> cheers
> Dan
> Ack
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
Hi Dan,
From a userland perspective I like both of these, a lot.
I have a question though, and i wasn’t sure if you’d rather discuss particular points here on in
a GH issue.
Would the changes to spl_autoload_* impact on the built in autoload implementation, spl_autoload?
Cheers
Stephen