Skip to content

InvalidTag::flattenExceptionBacktrace() corrupts reference arguments #249

Closed
@nikic

Description

@nikic

If there are any arguments in the backtrace that are references, InvalidTag::flattenExceptionBacktrace() may corrupt them by converting them to strings. This came up in nikic/PHP-Parser#687.

The underlying PHP bug/feature https://bugs.php.net/bug.php?id=79108 that allows this has been fixed/removed in PHP 8.0, but this still needs a fix in this library in the meantime. It should be possible to remove the references using something like:

$val = $array[$x];
unset($array[$x]);
$array[$x] = doYourTransform($val);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions