Signatur
class Error implements Throwable
Beschreibung
Anders als Exception für System-/Compile-Fehler. Beide implementieren Throwable — catch (\Throwable $e) fängt beide.
Rückgabewert
Typ
Error
Beschreibung
Instanz.
Beispiele
Catch-All
<?php
try {
riskyThing();
} catch (\Throwable $t) {
// fängt Exceptions UND Errors
logger()->error($t);
}