为什么不能将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