We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running any one of these commands:
php artisan tinker --execute="optional('foo', fn($v) => dump($v));" php artisan tinker --execute="transform('foo', fn($v) => dump($v));" php artisan tinker --execute="tap('foo', fn($v) => dump($v));" php artisan tinker --execute="with('foo', fn($v) => dump($v));" php artisan tinker --execute="optional('foo', function ($v) { dump($v); });" php artisan tinker --execute="transform('foo', function ($v) { dump($v); });" php artisan tinker --execute="tap('foo', function ($v) { dump($v); });" php artisan tinker --execute="with('foo', function ($v) { dump($v); });"
Produces this error
TypeError: Too few arguments to function dump(), 0 passed in /Users/danmason/PhpstormProjects/xxxeval()'d code on line 2 and exactly 1 expected
Running the same functions in PsySh works as expected
$ php artisan tinker Psy Shell v0.11.2 (PHP 8.1.4 — cli) by Justin Hileman >>> optional('foo', fn($v) => dump($v)); "foo" => "foo" >>> transform('foo', fn($v) => dump($v)); "foo" => "foo" >>> tap('foo', fn($v) => dump($v)); "foo" => "foo" >>> with('foo', fn($v) => dump($v)) "foo" => "foo"
The text was updated successfully, but these errors were encountered:
You need to escape the $ sign when running this in the CLI:
$
$ php artisan tinker --execute="optional('foo', fn(\$v) => dump(\$v));" "foo"
Sorry, something went wrong.
No branches or pull requests
Steps To Reproduce:
Running any one of these commands:
Produces this error
TypeError: Too few arguments to function dump(), 0 passed in /Users/danmason/PhpstormProjects/xxxeval()'d code on line 2 and exactly 1 expected
Running the same functions in PsySh works as expected
The text was updated successfully, but these errors were encountered: