1 | <?php |
||
15 | class ErrorLog implements ErrorHandlerInterface |
||
16 | { |
||
17 | /** |
||
18 | * Constructor |
||
19 | * |
||
20 | * @param string|null $logfile path to error.log-file; null: PHP default error log |
||
21 | */ |
||
22 | public function __construct(?string $logfile = null) |
||
28 | |||
29 | public function handleError(int $errno, string $errstr, ?string $errfile, ?int $errline) |
||
33 | |||
34 | public function handleException(\Throwable $exception) |
||
44 | |||
45 | public function handleShutdown() |
||
53 | |||
54 | protected function log(int $code, string $message, ?string $file, ?string $line): void |
||
58 | } |
||
59 |
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: