1 | <?php |
||
15 | class Exception extends \Exception { |
||
16 | public function __construct(string $message = "", int $code = 0, Throwable $previous = null) { |
||
19 | |||
20 | /** |
||
21 | * @param string|null $path |
||
22 | * @param string|int|null $error |
||
23 | * @return Exception |
||
24 | */ |
||
25 | public static function unknown(?string $path, $error): Exception { |
||
33 | |||
34 | /** |
||
35 | 2 | * @param array<int|string, class-string<Exception>> $exceptionMap |
|
36 | * @param string|int|null $error |
||
37 | * @param string|null $path |
||
38 | * @return Exception |
||
39 | */ |
||
40 | public static function fromMap(array $exceptionMap, $error, ?string $path): Exception { |
||
52 | } |
||
53 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: