Does return var not work when var is huge?

So I use PHPExcel ( http://phpexcel.codeplex.com/ ) to import an excel sheet. everything works fine in my development system, BUT it doesn't quite work on a live system.

So I debugged and looked at what might be wrong. I got to the point where I found that the method obviously returns NULL, where it should have returned the object. I looked at this method and var_dump()edited the var that was returned in the method. var was not NULL

PSEUDO CODE:

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

What am I doing wrong? Is this a problem that comes from php.ini?

+3
source share
3 answers

, !

+1

. - , , , , , , .

, , $bar =& new Bar(); $bar = new Bar(); ( PHP5); , .

0

PHP , , ( ). , ... PHPExcel. ? ? (IIRC Foobar) ?

0
source

Source: https://habr.com/ru/post/1751632/


All Articles