ReflectionClass::isReadOnly

(PHP 8 >= 8.2.0)

ReflectionClass::isReadOnlyChecks if class is readonly

Descrizione

public ReflectionClass::isReadOnly(): bool

Checks if a class is readonly.

Elenco dei parametri

Questa funzione non contiene parametri.

Valori restituiti

true if a class is readonly, false otherwise.

Esempi

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)

Vedere anche:

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top