在调试一个PHP程序时返回这样的错误:
Notice: Only variable references should be returned by reference in /www/include/template.class.php 43
追踪至该行:
42 function &fetch ( $tplname ) {
43 return $this->display ( $tplname, 0 );
44 }
百思不得其解,便从网上找来一个答案:
it is just saying it doesn't like returning the value from the function... you could always put it in a var and return that.(from lig@codewalkers.com ::Feb 2 2006 06:25 PM)
于是将该函数改为:
42 function &fetch ( $tplname ) {
43 $v = $this->display ( $tplname, 0 );
44 return $v;
45 }
再测试,问题解决。