(PHP 8 >= 8.2.0)
ReflectionClass::isReadOnly — Checks if class is readonly
Questa funzione non contiene parametri.
true
if a class is readonly, false
otherwise.
Example #1 ReflectionClass::isReadOnly() example
<?php
class TestClass { }
readonly class TestReadOnlyClass { }
$normalClass = new ReflectionClass('TestClass');
$readonlyClass = new ReflectionClass('TestReadOnlyClass');
var_dump($normalClass->isReadOnly());
var_dump($readonlyClass->isReadOnly());
?>
Il precedente esempio visualizzerĂ :
bool(false) bool(true)