Re: function autoloading v4 RFC
| From: | Rob Landers | Date: | Thu, 15 Aug 2024 21:31:50 +0000 |
| Subject: | Re: function autoloading v4 RFC | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-124960@lists.php.net to get a copy of this message | ||
On Thu, Aug 15, 2024, at 18:18, Stephen Reay wrote:
>
>
>> On 15 Aug 2024, at 22:22, Rob Landers <rob@bottled.codes> wrote:
>>
>> Hello internals,
>>
>> I've decided to attempt an RFC for function autoloading. After reading hundreds of
>> ancient (and recent) emails relating to the topic along with several abandoned RFCs from the past,
>> and after much review, I've decided to put forth a variation of a previous RFC, as it seemed
>> the least ambitious and the most likely to work:
>>
>> https://wiki.php.net/rfc/function_autoloading4
>>
>> Please let me know what you think. An implementation should be along before opening it for
>> a vote (now that I realize how important that is).
>>
>> — Rob
>
> Hi Rob,
>
> I like the simplicity of this, however your RFC doesn't document the changes required to
>
spl_autoload[1] to allow it to keep working with this new
> functionality.
Ah, good catch. I've updated this and gone through other relevant functions.
>
> The same issue (unexpected additional argument) potentially affects userland autoloaders too,
> but obviously the individual authors can fix that themselves (whether this would count as a BC break
> is not immediately clear to me)
Userland functions don't throw that error, so it shouldn't be an issue. (You can pass as
many arguments as you want to a userland function, as long as there are enough of them).
>
>
> Slightly tangentially, you may also want to look at a change to
> spl_autoload_call to accept a Ч7
> £áQëŽü`Àº{SPL_AUTOLOAD_* argument, so that it works consistently.
Done.
Thank you Stephen for pointing out this oversight.
>
> Cheers
>
> Stephen
>
> 1: https://www.php.net/spl_autoload
>
— Rob