- property_exists: documentation ( source)
- var_dump: documentation ( source)
<?php
#[AllowDynamicProperties]
class Foo {
public function __get( $name ) {
return $this->$name;
}
public function __set( $name, $value ) {
return $this->$name = $value;
}
public function __isset( $name ) {
return isset( $this->$name );
}
public function __unset( $name ) {
unset( $this->$name );
}
}
$foo = new Foo();
var_dump(property_exists( $foo, 'enable'));
$foo->enable = true;
var_dump(property_exists( $foo, 'enable'));