ReflectionClass::isFinal

(PHP 5, PHP 7)
Checks if class is final
public bool ReflectionClass::isFinal ( void )

Checks if a class is final.

Returns:

Returns TRUE on success or FALSE on failure.

Examples:
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)
See also:

ReflectionClass::isAbstract() -

Final Keyword -

doc_php
2016-02-24 16:13:24
Comments
Leave a Comment

Please login to continue.