I was getting “too much recursion” in firefox console by using this simple string
string_a = string_a + $row['name'];
After experimenting with it I found that the “too much recursion” is thrown at 180th loop. So if you have 179 result, it should not through error.
I also tested the same code in Safari on Mac and the behavior is exactly the same. It throws error at 180 recursion, however the error it throws is different. In case of Safari the following error is thrown
RangeError: Maximum call stack size exceeded.
Hope it helps somebody!