Hi,
I'm having some problems with objects, could someone just confirm if this is possible or if I'm fighting a loosing battle, this code isn't my actual code it's just a representation of what I want to achieve, basically I want to be able to return false from the default constructor of a class if an action fails, the if() always seems to evalute to true:
class someClass {
var myVar;
function someClass() {
$this->myVar = 'test'
if($a = 1) return true;
else return false;
}
}
$newObject = new someClass();
if($newObject) echo 'true';
else echo 'false';
Thanks in advance, i've been staring at it too long.
Andrew