Error Caught: ArgumentCountError:Too few arguments to function Application\Error\GeneratesError::__construct(), 0 passed in /var/www/html/php7cookbook/source/chapter13/chap_13_error_handler.php on line 16 and exactly 1 expected
( ! ) Warning: file_put_contents(/var/www/html/php7cookbook/source/chapter13/logs/20261121.log): Failed to open stream: No such file or directory in /var/www/html/php7cookbook/source/Application/Error/Handler.php on line 23
Call Stack
#TimeMemoryFunctionLocation
10.0025368808Application\Error\Handler->exceptionHandler( $ex = class ArgumentCountError { protected $message = 'Too few arguments to function Application\\Error\\GeneratesError::__construct(), 0 passed in /var/www/html/php7cookbook/source/chapter13/chap_13_error_handler.php on line 23 and exactly 1 expected'; private string ${Error}string = ''; protected $code = 0; protected string $file = '/var/www/html/php7cookbook/source/Application/Error/GeneratesError.php'; protected int $line = 6; private array ${Error}trace = [0 => [...]]; private ?Throwable ${Error}previous = NULL } ).../Handler.php:0
20.0025369320file_put_contents( $filename = '/var/www/html/php7cookbook/source/chapter13/logs/20261121.log', $data = 'EXCEPTION: 2026-11-21 15:25:28 : ArgumentCountError : Too few arguments to function Application\\Error\\GeneratesError::__construct(), 0 passed in /var/www/html/php7cookbook/source/chapter13/chap_13_error_handler.php on line 23 and exactly 1 expected\n', $flags = 8 ).../Handler.php:30
30.0026369768Application\Error\Handler->errorHandler( $errno = 2, $errstr = 'file_put_contents(/var/www/html/php7cookbook/source/chapter13/logs/20261121.log): Failed to open stream: No such file or directory', $errfile = '/var/www/html/php7cookbook/source/Application/Error/Handler.php', $errline = 30 ).../Handler.php:30
40.0026370088file_put_contents( $filename = '/var/www/html/php7cookbook/source/chapter13/logs/20261121.log', $data = 'ERROR : 2026-11-21 15:25:28 : 2 : file_put_contents(/var/www/html/php7cookbook/source/chapter13/logs/20261121.log): Failed to open stream: No such file or directory : /var/www/html/php7cookbook/source/Application/Error/Handler.php : 30\n', $flags = 8 ).../Handler.php:23