(PHP 5, PHP 7)
ReflectionClass::isFinal — Checks if class is final
public ReflectionClass::isFinal ( ) : bool
Checks if a class is final.
This function has no parameters.
Returns true
on success or false
on failure.
Example #1 ReflectionClass::isFinal() example
<?php class TestClass { } final class TestFinalClass { } $normalClass = new ReflectionClass('TestClass'); $finalClass = new ReflectionClass('TestFinalClass'); var_dump($normalClass->isFinal()); var_dump($finalClass->isFinal()); ?>
The above example will output:
bool(false) bool(true)
© 1997–2020 The PHP Documentation Group
Licensed under the Creative Commons Attribution License v3.0 or later.
https://www.php.net/manual/en/reflectionclass.isfinal.php