无法将pthreads Stackable对象转换为boolean

时间:2014-02-14 15:01:34

标签: php object pthreads boolean

为什么不能将pthreads Stackable对象转换为boolean?

代码:

<?php
class StackableAr extends Stackable{
    public function run(){}
}

$obj = new StackableAr();

if(!$obj){
    print "not set\n";
}

这会导致以下错误: PHP Catchable fatal error: Object of class StackableAr could not be converted to boolean

0 个答案:

没有答案