Is it possible use multiple classes under the same namespace, in the same file? I want to do something like this:
<?php
namespace MyNamespaceHelpersExceptions
use Exception;
class CustomException1 extends Exception{}
class CustomException2 extends Exception{}
class CustomException3 extends Exception{}
to avoid using one single file for each custom exception class.
The problem is, when I try to use, in another class, one of the custom exceptions,
use MyNamespaceHelpersExceptionsCustomException1;
the CustomException1 class is not found. Any ideas?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…