This is not what I asked though. I was wondering if
the mysql result set will be freed if I don't call
mysql_free_result, but rather remove all references
to it, e.g. by returning from the function where it was
defined.
This seems like the logical behavior, and the test
I just did verified that this is what happens. This
means that there's no point in calling mysql_free_result()
in a function that is about to return. You only need it
if you're doing a large number of queries within the
same scope and store your result sets in different
variables. My experience with PHP3 tells me that
that something has changed since then. In PHP3 it
was important to call mysql_free_result() in loops,
or PHP would eat RAM like crazy.