Tinker crashes on enum redeclaration #60563
Unanswered
ahsanul-turzo
asked this question in
Q&A
Replies: 1 comment
-
|
Not sure if this is a bug. If you declare two or more enums with the same FQCN, this should happen, too, shouldn't it? But I get that this is annoying, same with |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Laravel Version
13.15.0
PHP Version
8.4.8
Database Driver & Version
8.0.42 MySQL Community Server - GPL
Description
Re-declaring enum crashed the entire session of tinker, adding error handling might fix this.
Steps To Reproduce
PS D:\ProjectFiles\PHP> php .\artisan tinker
Psy Shell v0.12.23 (PHP 8.4.8 — cli) by Justin Hileman
New PHP manual is available (latest: 3.0.1). Update with
doc --update-manualPARSE ERROR PHP Parse error: Syntax error, unexpected ',', expecting ';' in vendor\psy\psysh\src\Exception\ParseErrorException.php on line 44.
PARSE ERROR PHP Parse error: Syntax error, unexpected T_STRING in vendor\psy\psysh\src\Exception\ParseErrorException.php on line 44.
PARSE ERROR PHP Parse error: Syntax error, unexpected T_STRING in vendor\psy\psysh\src\Exception\ParseErrorException.php on line 44.
PHP Fatal error: Cannot redeclare enum UserRole (previously declared in D:\ProjectFiles\PHP\vendor\psy\psysh\src\ExecutionLoopClosure.php(55) : eval()'d code:1) in D:\ProjectFiles\PHP\vendor\psy\psysh\src\ExecutionLoopClosure.php(55) : eval()'d code on line 1
Symfony\Component\ErrorHandler\Error\FatalError
Cannot redeclare enum UserRole (previously declared in D:\ProjectFiles\PHP\vendor\psy\psysh\src\ExecutionLoopClosure.php(55) : eval()'d code:1)
at vendor\psy\psysh\src\ExecutionLoopClosure.php:55$_ = eval($ psysh->onExecute($psysh->flushCode() ?: ExecutionClosure::NOOP_INPUT));
51▕ // Convert all errors to exceptions
52▕ \set_error_handler([$psysh, 'handleError']);
53▕
54▕ // Evaluate the current code buffer
➜ 55▕
56▕ } catch (\Throwable $_e) {
57▕ // Clean up on our way out.
58▕ if (\ob_get_level() > 0) {
59▕ \ob_end_clean();
Whoops\Exception\ErrorException
Cannot redeclare enum UserRole (previously declared in D:\ProjectFiles\PHP\vendor\psy\psysh\src\ExecutionLoopClosure.php(55) : eval()'d code:1)
at vendor\psy\psysh\src\ExecutionLoopClosure.php:55$_ = eval($ psysh->onExecute($psysh->flushCode() ?: ExecutionClosure::NOOP_INPUT));
51▕ // Convert all errors to exceptions
52▕ \set_error_handler([$psysh, 'handleError']);
53▕
54▕ // Evaluate the current code buffer
➜ 55▕
56▕ } catch (\Throwable $_e) {
57▕ // Clean up on our way out.
58▕ if (\ob_get_level() > 0) {
59▕ \ob_end_clean();
1 vendor\filp\whoops\src\Whoops\Run.php:520
Whoops\Run::handleError("Cannot redeclare enum UserRole (previously declared in D:\ProjectFiles\PHP\vendor\psy\psysh\src\ExecutionLoopClosure.php(55) : eval()'d code:1)", "D:\ProjectFiles\PHP\vendor\psy\psysh\src\ExecutionLoopClosure.php(55) : eval()'d code")
2 [internal]:0
Whoops\Run::handleShutdown()
PS D:\ProjectFiles\PHP>
Beta Was this translation helpful? Give feedback.
All reactions