dongwen9975 2011-05-13 19:47
浏览 86

file_get_contents内存问题

I'm using file_get_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?

  • 写回答

1条回答 默认 最新

  • douzhangli9563 2011-05-13 19:51
    关注

    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.

    评论

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度