This is a really good thread...
Now I'm really confused... :-)
I've been Googling a bit and it seems as though the memory constraints are on MySQL and not necessarily PHP. As you may notice, you can select some very large result sets with PHP and most PHP configurations are setup with fairly low memory. So... my thinking is that the memory under question is the memory that MySQL consumes not PHP. I know I can cause a timeout in PHP by requesting a large result set and I assume that's because PHP is waiting on MySQL to complete.
Googles I've tried so far:
1- mysql out of memory error
2- mysql_query out of memory error
3- Others...
Also, this seems to put some light on the subject:
http://www.php.net/manual/en/languag...s.resource.php
Thanks for the great brain-teaser!
Be nice if someone who's delved-deep pipes in...
I'll look into the driver source code and see if I can get a definitive answer.