ReflectionClass::isAbstract

(PHP 5, PHP 7, PHP 8)

ReflectionClass::isAbstractChecks if class is abstract

Description

public ReflectionClass::isAbstract(): bool

Checks if the class is abstract.

Parameters

This function has no parameters.

Return Values

Returns true on success or false on failure.

Examples

Example #1 ReflectionClass::isAbstract() example

<?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:

bool(false)
bool(true)

See Also