[php-src] Issue #9675: "Cannot instantiate" from|trait|abstract class from

From: Date: Wed, 05 Oct 2022 13:56:36 +0000
Subject: [php-src] Issue #9675: "Cannot instantiate" from|trait|abstract class from
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-242528@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/9675
Author: PhilETaylor

### Description

Im sorry but I cannot replicate this on demand. I cannot give you a test case and the details I have
are very vague. 

Basically, when trying to instantiate a concrete class, PHP will randomly throw an exception with
the message in the format of the following - note this is the FULL message, the actual class is not
mentioned and the message appears to be truncated.

``"Cannot instantiate interface from"``

``"Cannot instantiate abstract class from"``

``"Cannot instantiate trait from"``

The code for this appears to be somewhere near https://github.com/php/php-src/blob/adb45a63c0f56bb4e04ffd74579de0c8ab9d722f/Zend/zend_API.c#L1669

Full details were first discovered when running Symfony in PHP 8.2 rc 2 in production (I know I know
but someone has to lead :)) 

https://github.com/symfony/symfony/issues/47653

A further report was then made by @julienchey else in Monolog with PHP 8.1.0

https://github.com/Seldaek/monolog/issues/1765

// Tagging @stof @mfn

### PHP Version

Observed in 8.1.0/8.2.0rc2/8.2.0rc3

### Operating System

Alpine Docker Container


Thread (1 message)

  • PhilETaylor
« previous php.bugs (#242528) next »