Skip to content
New issue

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

"Cannot redeclare function" #12

Closed
nxmndr opened this issue Dec 1, 2022 · 1 comment
Closed

"Cannot redeclare function" #12

nxmndr opened this issue Dec 1, 2022 · 1 comment

Comments

@nxmndr
Copy link

nxmndr commented Dec 1, 2022

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
Copy link
Member

billyct commented Dec 5, 2022

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:

bobthecow/psysh#416

@billyct billyct closed this as completed Dec 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants