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 origi
> 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 exact
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
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 be