Skip to content

Make Exception::$trace typed array property #5636

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

nikic
Copy link
Member

@nikic nikic commented May 28, 2020

This is a private property, so we are allowed to add a type. The new declaration of the property is

private array $trace = [];

This ensures that Exception::getTrace() does indeed return an array.

Userland code that was removing the trace by assigning null via reflection needs to be updated to assign [] instead.

@nikic nikic force-pushed the exception-trace-type branch from fb8993c to 1a51ba2 Compare May 28, 2020 10:45
@carusogabriel carusogabriel added this to the PHP 8.0 milestone May 28, 2020
@php-pulls php-pulls closed this in aaae77f May 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants