Skip to content

Add support for variadic parameters and null values#1849

Merged
cleptric merged 3 commits intomasterfrom
add-variadic-parameters
Jun 9, 2025
Merged

Add support for variadic parameters and null values#1849
cleptric merged 3 commits intomasterfrom
add-variadic-parameters

Conversation

@cleptric
Copy link
Copy Markdown
Member

@cleptric cleptric commented Jun 7, 2025

before after
Firefox 2025-06-07 07 23 11 Firefox 2025-06-07 07 22 57

Adding support for variadic parameters and null values in stacktraces.
Method was called with:

Numbers::process(10, null, 40, 50, 60, 70);

Closes #1645

@cleptric cleptric self-assigned this Jun 7, 2025
@cleptric cleptric requested a review from stayallive June 7, 2025 05:27
@cleptric cleptric merged commit 77359d0 into master Jun 9, 2025
38 checks passed
@cleptric cleptric deleted the add-variadic-parameters branch June 9, 2025 16:18
@poldixd
Copy link
Copy Markdown

poldixd commented Jun 12, 2025

Since updating to version 4.13.0, I’m encountering the following error during CI tests:

  Undefined array key 0
  at vendor/sentry/sentry/src/FrameBuilder.php:226
    222▕             if ($reflectionParameter->isVariadic()) {
    223▕                 // For variadic parameters, collect all remaining arguments into an array
    224▕                 $variadicArgs = [];
    225▕                 for ($i = $parameterPosition; $i < \count($backtraceFrameArgs); ++$i) {
  ➜ 226▕                     $variadicArgs[] = $backtraceFrameArgs[$i];
    227▕                 }
    228▕                 $argumentValues[$reflectionParameter->getName()] = $variadicArgs;
    229▕                 // Variadic parameter is always the last one, so we can break
    230▕                 break;
      +15 vendor frames 

Interestingly, I’m unable to reproduce this issue locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stack traces are missing variadic and not declared arguments

3 participants