Bug #81630 [Opn]: PHP 8.1: ReflectionClass->getTraitAliases() crashes with Internal error

From: Date: Wed, 17 Nov 2021 13:43:12 +0000
Subject: Bug #81630 [Opn]: PHP 8.1: ReflectionClass->getTraitAliases() crashes with Internal error
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-237812@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=81630&edit=1 ID: 81630 Updated by: nikic@php.net Reported by: ondrej at mirtes dot cz Summary: PHP 8.1: ReflectionClass->getTraitAliases() crashes with Internal error Status: Open Type: Bug Package: Reflection related Operating System: N/A PHP Version: 8.1.0RC6 Block user comment: N Private report: N New Comment: Any non-simple way of reproducing it (like running phpstan tests?) I don't think this is directly related to getTraitAliases(), the exception indicates that the ReflectionClass object is not fully uninitialized. Previous Comments: ------------------------------------------------------------------------ [2021-11-17 12:55:14] ondrej at mirtes dot cz Description: ------------ Unfortunately I don't have a simple reproducing script here, but I know there's a bug in ReflectionClass when asking for trait aliases. A code that executes the same methods crashes when I run it in context of PHPStan: https://3v4l.org/oSI4m The error message is: Uncaught Error: Internal error: Failed to retrieve the reflection object in phar:///var/www/html/vendor/phpstan/phpstan/phpstan.phar/src/Reflection/Php/PhpClassReflectionExtension.php:576 #0 phar:///var/www/html/vendor/phpstan/phpstan/phpstan.phar/src/Reflection/Php/PhpClassReflectionExtension.php(576): ReflectionClass->getTraitAliases() #1 Maybe it's related to some internal state of ReflectionClass or maybe the way how it was obtained, but calling ReflectionClass->getTraitAliases() always results in a crash on PHP 8.1. It works on PHP 8.0. Hopefully this gives you enough information to track it down. Thanks. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=81630&edit=1

« previous php.bugs (#237812) next »