> 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.
Hi! Just a Little question. I see this other document in the same repo: https://github.com/Danack/FunctionTypes/blob/master/3_referencing_functions_and_callables.md Are you planning to also raise it? As userland developer it really bothers me to type function and method names in strings. Thanks in advance! Un saludo, Iván Arias. De: Dan Ackroyd<mailto:dan...@basereality.com> Enviado: miércoles, 20 de mayo de 2020 15:01 Para: PHP internals<mailto:internals@lists.php.net> Asunto: [PHP-DEV] Draft RFC callable types + callable type/function autoloading 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