php8.5
Home/ Manual/ reflection / reflectionclass/ ReflectionClass::isAbstract

ReflectionClass::isAbstract

PHP function Edit on GitHub ✎

(PHP 5, PHP 7, PHP 8)

Checks if class is abstract

Description

ReflectionClass::isAbstract(): bool

Checks if the class is abstract.

Parameters Parameters

Return Values

Returns true if the class is abstract or false otherwise.

Examples

ReflectionClass::isAbstract example

php
<?php
class          TestClass { }
abstract class TestAbstractClass { }

$testClass     = new ReflectionClass('TestClass');
$abstractClass = new ReflectionClass('TestAbstractClass');

var_dump($testClass->isAbstract());
var_dump($abstractClass->isAbstract());
?>

The above example will output:

output
bool(false)
bool(true)

See Also

Source: reference/reflection/reflectionclass/isabstract.xml · from the official PHP manual (php/doc-en)