【发布时间】:2011-08-20 13:23:56
【问题描述】:
如何让下面的$foo 变量知道 foo 应该为假?
class foo extends fooBase{
private
$stuff;
function __construct($something = false){
if(is_int($something)) $this->stuff = &getStuff($something);
else $this->stuff = $GLOBALS['something'];
if(!$this->stuff) return false;
}
}
$foo = new foo(435); // 435 does not exist
if(!$foo) die(); // <-- doesn't work :(
【问题讨论】:
标签: php class object constructor