- property_exists: documentation ( source)
- var_dump: documentation ( source)
<?php
class x
{
public function __set($name, $value)
{
if ($value == 'mooo')
$this->doSomethingPotentiallySetty();
var_dump(property_exists($this, $name));
}
public function doSomethingPotentiallySetty()
{
$this->test = 123;
}
}
$x = new x();
$x->doSomethingPotentiallySetty();
var_dump($x);
$x->test = 'mooo';
var_dump($x);