Re: [PHP-DEV] Empower Callables with Function Signature Hints

2021-04-08 Thread Hamza Ahmad
Hello, I thanks Saif for adding to my argument and providing with the list of other languages/tools that support such a functionality. As Saif has mentioned about "typesafe callables" RFC that is now inactive, I want to also point out toward another rfc that was declined. It was Callable Prototype

Re: [PHP-DEV] Empower Callables with Function Signature Hints

2021-04-07 Thread Saif Eddin Gmati
Hello Hamza, I think this is something that has been discussed here before. function types already exist in HackLang: https://docs.hhvm.com/hack/functions/introduction#function-types, And, if we would follow the same syntax `(function(T, T): T)` or `(callable(T, T): T)`, PHP needs to first sup

[PHP-DEV] Empower Callables with Function Signature Hints

2021-04-07 Thread Hamza Ahmad
Hello Internals, I want to request making possible to catch functions with wrong signature when passed as callable. In other words, when a function or a method is passed as callable value, PHP will first confirm whether the function is of the write callable type that the function being executed req