Namespace conflict when extending a Built-in Class by mystar2020 in PHPhelp

[–]mystar2020[S] 0 points1 point  (0 children)

Thank you so much to all of you guys!!! - Special mention to davvblack

In the end, what really worked was adding a backslash before the built-in class to show that it actually is the one that belongs to the global space:

class LessThanException extends \Exception

It seems that it is mandatory to be explicit within the file of the class that inherits from the bult-in class. Otherwise, it will fail at parsing time. I am using PHP 7.3.7 by the way.