开发者

file_get_contents memory issue

I'm using file_get_开发者_Go百科contents just to call a php file (which returns some data); like that:

file_get_contents('http://example.com/foo.php'); and NOT e.g. $holding_var = file_get_contents('http://example.com/foo.php');

Will it use the assigned memory of 20kB (let's say the meant file called by my script returns a 10kB response) or will not use the memory at all since the result is not stored in any variable?


The code as you have it written, will just open the file on disk, read it's contents, and then do nothing with it.

Yes, it will use up the assigned memory of 20kb, but then it will be freed by the php runtime garbage collector at some point.

I don't understand why you would ever write code like this though. It won't execute the code in the .php file.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜