0

Laravel Tinker runs in Terminal, but anytime I try to get it to compute anything it exits and returns to the command line. This is a typical terminal command which I try, and Tinker exits without doing anything every time I press the Enter button.

USER-MBP:blog name$ php artisan tinker

Psy Shell v0.9.9 (PHP 7.3.1 — cli) by Justin Hileman

>>> 2 + 2

USER-MBP:blog name$ 

I would expect the next line of after 2 + 2 to be 4 yet when I press enter it does not compute and exits back out to the Terminal command line.

Devon Bessemer
  • 34,461
  • 9
  • 69
  • 95
  • You probably have one file somewhere starting with `[` as first char following by ` – Clément Baconnier Jan 21 '19 at 20:31
  • Possible duplicate of [PHP Artisan Tinker crashing from any command](https://stackoverflow.com/questions/53773098/php-artisan-tinker-crashing-from-any-command) – muhive May 12 '19 at 11:44

2 Answers2

3

This is actually an open issue with Psysh (which tinker is based on) and php 7.3: https://github.com/bobthecow/psysh/issues/540

There is a work around described here: https://github.com/bobthecow/psysh/issues/540#issuecomment-445546060

khartnett
  • 831
  • 4
  • 14
-1

I also had this problem with php7.3, I simply reverted to php7.2. Unless you've got to have it I suggest using php@7.2 as the solution.

ravenshill
  • 309
  • 2
  • 8