Req #48842 [Opn->Fbk]: Add class_is_instantiable/class_is_abstract functions

From: Date: Fri, 09 Mar 2018 12:01:05 +0000
Subject: Req #48842 [Opn->Fbk]: Add class_is_instantiable/class_is_abstract functions
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-214247@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=48842&edit=1 ID: 48842 Updated by: cmb@php.net Reported by: eitan at mosenkis dot net Summary: Add class_is_instantiable/class_is_abstract functions -Status: Open +Status: Feedback Type: Feature/Change Request Package: Class/Object related PHP Version: 5.2.10 -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: What's wrong with (new ReflectionClass($classname))->isAbstract() Previous Comments: ------------------------------------------------------------------------ [2009-07-07 22:33:32] eitan at mosenkis dot net Description: ------------ It would be rather useful to have functions to check if a class is abstract/instantiable, given that the only way right now is through ReflectionClass since just trying to instantiate it causes a fatal error which can't be caught. The usage case is when you use get_declared_classes() to iterate through all available classes and want to instantiate some or all of them, but want to avoid those that will kill your script when you try. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=48842&edit=1

« previous php.bugs (#214247) next »