Switched from Homestead to valet because I'm curious.
Now, running php artisan tinker will still open the shell, but any executed command closes the shell without error message or displaying the result. Doing php artisan tinker 'command' to immediately execute a shell command will cause the same.
App\Models\User::first() and 1+1 both cause the closing.Any help on how to further debug this is greatly appreciated!
This isn't directly a Valet issue, but rather with one of its dependencies.
It's a problem with PsySh (used by Tinker) and Homebrew's PHP 7.3.0 build.
Related:
https://github.com/laravel/tinker/issues/63
https://github.com/bobthecow/psysh/issues/540
You could use one of the posted workarounds in the PsySh link or downgrade to PHP 7.2
Thank you for your help, @drbyte ! My Google-fu failed me this time
No worries - I ran into the same thing a couple days ago, so your post gave me an extra reason to document it.
Use this as a workaround:
In php.ini set pcre.jit=0
I got the same problem using homestead.
Work for me running php artisan tinker inside the Homestead enviroment, after use vagrant ssh.
Solution provided by @rsm23 worked for me. Using Laravel Valet.
Solution from @rsm23 worked.
Problem was created after upgrade my HomeBrew.
@rsm23 solution worked for me also, thanks a lot.
The cause i am still unsure about.
Much thanks to @rsm23, solution worked for me as well.
Please friends, I do not need to receive an email every time one of you discovers that the solution marked as working is working :)
@bobthecow in the PsySH issue recommends to disable PCNTL support in the PsySH config file (~/.config/psysh/config.php). It works for me (PHP 7.3.7, MacOS 10.14.16).
return [
'usePcntl' => false,
];
Most helpful comment
Use this as a workaround:
In php.ini set pcre.jit=0