Afficher un message
Vieux 27/03/2008, 15h33   #1
wswilson
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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?
  Réponse avec citation
 
Page generated in 0,04506 seconds with 9 queries