所以我正在使用 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 的问题吗?
最佳答案
更高的内存限制似乎解决了这个问题!
关于php - 当 var 很大时 return var 不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3112424/