You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<?phpdeclare(strict_types=1); // unfortunately strict types can not be declared on 3v4l.org$array = [1, 1.2, '1.2.3'];
// var_dump(array_filter($array, function (string $value) { return is_string($value); })); // will not filter// var_dump(array_map(fn (string $value) => $value, $array)); // all returned values are strings array_walk($array, fn (string &$value) => $value);
var_dump($array);
PHP Fatal error: Uncaught TypeError: {closure}(): Argument #1 ($a) must be of type string, int given, .....
(as is thrown when call_user_func is used with a closure with a wrong argument type)
PHP Version
PHP 8.3.6
Operating System
No response
The text was updated successfully, but these errors were encountered:
Description
The following code:
Resulted in this output:
But I expected this output instead:
PHP Version
PHP 8.3.6
Operating System
No response
The text was updated successfully, but these errors were encountered: