Level 50
If you do throw new \LogicException, does that work?
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello,
I want to use a LogicException class from PHP so I set in my code:
"use LogicException;
if (Atest) { Some Code } else { throw new LogicException("blablabla"); }"
But I have always this error:
"FatalThrowableError in Character.php line 243: Call to undefined function App\LogicException()"
Obviously, there is no LogicException class in my App Folder because I want to use the default PHP class.
Can someone help me? thank you in advance.
If you do throw new \LogicException, does that work?
Please or to participate in this conversation.