tinkerun / tinkerun-vscode

The missing way of running tinker in Visual Studio Code
https://tinke.run/vscode
MIT License
56 stars 2 forks source link

"Cannot redeclare function" #12

Closed nxmndr closed 1 year ago

nxmndr commented 1 year ago

Hi,

When I run a file twice or more, I have an error message saying that functions or classes "cannot be redeclared" / "already exists" : Cannot redeclare f() in Psy Shell, Class named C already exists. So I have to kill the shell manually every time.

I upgraded my system recently but I don't really know what triggered that change as I tested it with PHP 7 & 8.

Does it mean Tinkerun re-uses the same PsySH session ? Would it be feasible to kill it & start a new shell instead ?

Thank you

Versions : MacOS : 11.5.2 VSCode : 1.73.1 Tinkerun 0.2.2 PHP : 7.4.32 & 8.0.26 Laravel : 8.83.23

billyct commented 1 year ago

Does it mean Tinkerun re-uses the same PsySH session?

yes

Would it be feasible to kill it & start a new shell instead?

Kill terminal
  1. kill terminal
  2. run it again

References:

https://github.com/bobthecow/psysh/issues/416