Possible for class to return boolean?
Suppose I have:
class A {
function __construct() {
$this->val = true;
}
}
$a = new A();
if ($a) {
echo 'some text';
}
When I test "if ($a)", I want the class A to respond with the value of
$this->val, which is true at the moment.
Is this possible?
|