所以我使用 PHPExcel ( http://phpexcel.codeplex.com/ ) 来导入一个 Excel 表。在我的开发系统上一切正常,但在实时系统上却不太正常。
因此,我调试并查看了可能出现的问题。我发现一个方法显然返回 NULL,它应该返回一个对象。我查看了该方法,并var_dump()
编辑了该方法中返回的 var。var 不是 NULL
伪代码:
class Bar()
{
function methodInAClass()
{
$test = new Foobar;
[...]
/* $test was an object here with a lot of data (var_dump()
* took around 100.000 lines in an editor) */
var_dump($test);
return $test;
}
}
$bar =& new Bar();
$test2 = $bar->methodInAClass(); //$test2 is NULL here
我究竟做错了什么?这是来自 php.ini 的问题吗?