Force result for empty() test on an object
- by hsz
Hello !
Simple class for example:
class Foo
{
protected $_bar;
public function setBar( $value ) {
$this->_bar = $value;
}
}
And here is the question:
$obj = new Foo();
var_dump( empty( $obj ) ); // true
$obj->setBar( 'foobar' );
var_dump( empty( $obj ) ); // false
Is it possible to change class's…