<?php//любой метод может выбросить ошибкуfunction methodWithException() { throw new Exception("test exception");}