# Stack Traces and Arguments

> Section in “New and Extended Functionality › Error Handling” of the book [PHP 7 Explained](https://php7explained.com/) by Sebastian Bergmann and Stefan Priebsch, published by thePHP.cc. The book covers PHP 7.0 to 7.4 and was last updated in November 2020. HTML version: <https://php7explained.com/new-and-extended-functionality/error-handling/stack-traces-and-arguments/>

By default, the stack traces PHP prints when an exception is raised include information about the arguments passed to a function or method. The `zend.exception_ignore_args` configuration option was introduced in PHP 7.4 for controlling whether or not arguments should be included in these stack traces.

``` php
function f(int $x): void
{
    throw new Exception;
}

f(1);
```

Executing the code shown above with PHP 7.3 and earlier prints the output shown below:

    Fatal error: Uncaught Exception in example.php:4
    Stack trace:
    #0 example.php(7): f(1)
    #1 {main}
      thrown in example.php on line 4

The `#0 example.php(7): f(1)` line is the interesting one: `f(1)` indicates that the exception was raised from within the `f` function when it was called with the argument `1`.

Executing the same code with PHP 7.4 and the default setting of `zend.exception_ignore_args=0` prints the same output as PHP 7.3 and earlier.

Executing the same code with PHP 7.4 and `zend.exception_ignore_args=1` prints the output shown below:

    Fatal error: Uncaught Exception in example.php:4
    Stack trace:
    #0 example.php(7): f()
    #1 {main}
      thrown in example.php on line 4

The argument `f()` was called with is no longer shown in the stack trace.

---

Previous: [Chained Autoloaders and Exceptions](https://php7explained.com/new-and-extended-functionality/error-handling/chained-autoloaders-and-exceptions/index.html.md) | Next: [JSON_THROW_ON_ERROR](https://php7explained.com/new-and-extended-functionality/error-handling/json_throw_on_error/index.html.md)
