Re: [PHP-DEV] Callable arguments cannot have default value

2023-11-28 Thread Rowan Tommins
On 28/11/2023 09:54, Claude Pache wrote: The big problem with the `callable` type, is that it can be check only at runtime. For instance: ```php function foo(callable $x) { } foo('strlen'); // ok foo('i_dont_exist'); // throws a TypeError ``` To expand on this example, and address the

Re: [PHP-DEV] Callable arguments cannot have default value

2023-11-28 Thread Claude Pache
> Le 28 nov. 2023 à 00:59, Sergii Shymko a écrit : > > Hi, > > Wanted to bring up an inconsistent behavior of callable arguments compared to > arguments of other types. > Callable argument cannot have a default value (tested string or array types - > both are not permitted). > The same

Re: [PHP-DEV] Callable arguments cannot have default value

2023-11-28 Thread Robert Landers
On Tue, Nov 28, 2023 at 12:59 AM Sergii Shymko wrote: > > Hi, > > Wanted to bring up an inconsistent behavior of callable arguments compared to > arguments of other types. > Callable argument cannot have a default value (tested string or array types - > both are not permitted). > The same exact

[PHP-DEV] Callable arguments cannot have default value

2023-11-27 Thread Sergii Shymko
Hi, Wanted to bring up an inconsistent behavior of callable arguments compared to arguments of other types. Callable argument cannot have a default value (tested string or array types - both are not permitted). The same exact value works perfectly fine when passed dynamically, it just cannot