sentry-php icon indicating copy to clipboard operation
sentry-php copied to clipboard

Stack traces are missing variadic and not declared arguments

Open xwillq opened this issue 9 months ago • 8 comments

How do you use Sentry?

Self-hosted / on-premises

SDK version

4.0.1

Steps to reproduce

  1. Create function with variadic parameters or without parameters. Ex.:
function variadic(...$params) {...}
function noParams() {...}
  1. Call this function with some arguments.
  2. Throw an exception inside that function.

Expected result

Sentry shows all passed arguments in stack trace.

Actual result

Sentry shows only first argument for variadic function and no arguments for function without parameters. With this code:

function variadic(...$params)
{
    noParams($params);
}

function noParams()
{
    throw new \Exception();
}

Artisan::command('debug', function () {
    variadic('a', 1, [123]);
});

I get this stack trace in Sentry: CleanShot 2023-11-20 at 18 51 49@2x

xwillq avatar Nov 20 '23 13:11 xwillq