(PHP 8 >= 8.4.0)
ReflectionProperty::isDynamic — Checks if property is a dynamic property
Checks whether the property was declared at run-time, or whether the property was declared at compile-time.
This function has no parameters.
true
if the property was declared at run-time, or false
if
it was created at compile-time.
Example #1 ReflectionProperty::isDynamic() example
<?php
#[\AllowDynamicProperties]
class Foo {
public $bar;
}
$o = new Foo();
$o->bar = 42;
$o->baz = 42;
$ro = new ReflectionObject($o);
var_dump($ro->getProperty('bar')->isDynamic());
var_dump($ro->getProperty('baz')->isDynamic());
?>
The above example will output:
bool(false) bool(true)
Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!
Check out: eBank.nz (Art Generator) |
Netwrck.com (AI Tools) |
Text-Generator.io (AI API) |
BitBank.nz (Crypto AI) |
ReadingTime (Kids Reading) |
RewordGame |
BigMultiplayerChess |
WebFiddle |
How.nz |
Helix AI Assistant