Döngüsel olarak ve çıktılıyarak istisna izleme.
    
<?php
class MyCustomException extends Exception {}
function doStuff() {
    try {
        throw new InvalidArgumentException("Yanlış yapıyorsunuz!", 112);
    } catch(Exception $e) {
        throw new MyCustomException("Bir şeyler oldu", 911, $e);
    }
}
try {
    doStuff();
} catch(Exception $e) {
    do {
        printf("%s:%d %s (%d) [%s]\n", $e->getFile(), $e->getLine(),
                $e->getMessage(), $e->getCode(), get_class($e));
    } while($e = $e->getPrevious());
}
?>
     
    
Yukarıdaki örnek şuna benzer bir çıktı üretir:
/home/bjori/ex.php:8 Bir şeyler oldu (911) [MyCustomException]
/home/bjori/ex.php:6 Yanlış yapıyorsunuz! (112) [InvalidArgumentException]