|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
  [2005-05-16 09:41 UTC] arachnid at notdot dot net
 Description: ------------ Using file_get_contents with an HTTP url causes PHP (CLI, at least) to go into a 100% CPU loop if the connection breaks. Since there's no timeout context parameter, this persists indefinitely. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             | |||||||||||||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 08:00:01 2025 UTC | 
I didn't figure an example script would be particularaly useful, as the behaviour described requires the connection to stall or be reset while file_get_contents is running. An example script would simply consist of $data = file_get_contents('http://example.com/a.big.file'); and breaking the connection partway through downloading said file.