From 36dee2e18bb92ff72a7e5e4ab6625e320d2c4cb5 Mon Sep 17 00:00:00 2001 From: Clemens Schwaighofer Date: Fri, 10 Nov 2023 07:01:19 +0900 Subject: [PATCH] Readme update --- ReadMe.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/ReadMe.md b/ReadMe.md index e0d05cf..5079035 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -19,3 +19,40 @@ Alternative setup composer local zip file repot: ## Install package `composer require egrajp/exceptions-extended` + +## PHP Exception model + +Here's a chart that demonstrates the new hierarchy introduced in PHP 7: + +```txt +\Throwable +├── \Exception (implements \Throwable) +| |── \DOMException (extends \Exception) +| ├── \IntlException (extends \Exception) +| ├── \JsonException (extends \Exception) +| |── \PharException (extends \Exception) +| |── \ReflectionException (extends \Exception) +| |── \ValueError (extends \Exception) +│ ├── \LogicException (extends \Exception) +│ │ ├── \BadFunctionCallException (extends \LogicException) +│ │ │ └── \BadMethodCallException (extends \BadFunctionCallException) +│ │ ├── \DomainException (extends \LogicException) +│ │ ├── \InvalidArgumentException (extends \LogicException) +│ │ ├── \LengthException (extends \LogicException) +│ │ └── \OutOfRangeException (extends \LogicException) +│ └── \RuntimeException (extends \Exception) +│ ├── \OutOfBoundsException (extends \RuntimeException) +│ ├── \OverflowException (extends \RuntimeException) +│ ├── \RangeException (extends \RuntimeException) +│ ├── \UnderflowException (extends \RuntimeException) +│ └── \UnexpectedValueException (extends \RuntimeException) +└── \Error (implements \Throwable) + ├── \AssertionError (extends \Error) + ├── \ParseError (extends \Error) + └── \TypeError (extends \Error) + └── \ArgumentCountError (extends \TypeError) + └── \ArithmeticError (extends \Error) + └── \DivisionByZeroError (extends \ArithmeticError) +``` + +