计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
php-error-handling【效率与协作】Implement modern PHP error and exception handling patterns. Use when implementing exception hierarchies, error handlers, or custom exceptions in PHP.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
See implementation examples for directory layout.
throwing exceptions over returning false or null for error states.RuntimeException or LogicException for domain-specific errors.catch (DomainException | InvalidArgumentException $e).See implementation examples for domain exception hierarchy with multi-catch and finally.
Throwable for both PHP 7/8 Errors and Exceptions.set_exception_handler and set_error_handler for top-level logging and cleanup.finally for resource cleanup (e.g., closing file handles, DB connections).Psr\Log\LoggerInterface for structured error reporting.display_errors=Off and log_errors=On in production php.ini.@ error suppression: Handle or log errors explicitly.display_errors in production: Log to file; never show users.