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