Skip to content

Make Exception::$trace typed array property#5636

Closed
nikic wants to merge 1 commit into
php:masterfrom
nikic:exception-trace-type
Closed

Make Exception::$trace typed array property#5636
nikic wants to merge 1 commit into
php:masterfrom
nikic:exception-trace-type

Conversation

@nikic
Copy link
Copy Markdown
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