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) +``` + +