Description
The following code:
Resulted in this output:
Fatal error: Uncaught Error: Call to undefined function missing()
But I expected this output instead:
Fatal error: Uncaught Error: Unable to create closure from undefined function missing()
When using the first-class callable syntax on a missing function, the error message claims the user is calling a function. However, this should only be creating a closure.
I thought the (...) syntax would only try to create a closure. Does it actually try to call the function with a ... argument if it's not found?
If you use the original Closure::fromCallable() method, the error is different.
Closure::fromCallable('missing');
Uncaught TypeError: Failed to create closure from callable: function "missing" not found or invalid function name
PHP Version
8.1
Operating System
No response
Description
The following code:
Resulted in this output:
But I expected this output instead:
When using the first-class callable syntax on a missing function, the error message claims the user is calling a function. However, this should only be creating a closure.
I thought the
(...)syntax would only try to create a closure. Does it actually try to call the function with a...argument if it's not found?If you use the original
Closure::fromCallable()method, the error is different.PHP Version
8.1
Operating System
No response