1. I read the contents of the file into a buffer using file_get_contents
2. I wanted to know how many words there was, so I exploded the content based on a space.
Code: Select all
$content = file_get_contents("foo");
$words = explode(" ", $content);
echo count($words);My question is, why in the world is explode trying to use more than 64mb of memory? I figured I would ask here to try and save myself from having to look through the string.c source (it's not very pleasant)Fatal error: Allowed memory size of 67108864 bytes exhausted...