- property_exists: documentation ( source)
- var_dump: documentation ( source)
<?php
class Data
{
//public $foo = 'bar';
public function wtf() {
unset($this->foo);
}
}
$d = new Data;
$data->foo = 'bar';
var_dump('foo exists', property_exists($d, 'foo'));
$d->wtf();
var_dump('foo exists', property_exists($d, 'foo'));