How to generate the biggest output with the shortest code?
<p>I have a highly theoretical question. What is the shortest amount of code to generate the biggest output?</p>

<p>For example:</p>

<pre><code>echo md5(0);
</code></pre>

<p>outputs</p>

<pre><code>cfcd208495d565ef66e7dff9f98764da
</code></pre>

<p>therefore the rate of code typed and the output is 2.67 (the code contained 12 characters, the output 32, 32 / 12 = 2.67).</p>

<p>If we count errors as outputs, then typing the bare</p>

<pre><code>*
</code></pre>

<p>gives</p>

<pre><code>Parse error: syntax error, unexpected '*' in /x/y/index.php on line 1
</code></pre>

<p>with a rate of 69.</p>

<p>Now, <code>str_repeat</code> expects an integer parameter, what can be a maximum of 2^31 - 1.</p>

<pre><code>echo str_repeat("a",2147483647);
</code></pre>

<p>So theoretically this line could give a rate of</p>

<p>(2^31 - 1) / 32, about 67 million.</p>

<p>When I tried the code above it gave me an error:</p>

<pre><code>Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 2147483648 bytes) in /x/y/index.php on line 2
</code></pre>

<p>I guess allowed memory size limits our buffer, so the maximum amount of data we can store in temporary variables is the given value above. Therefore no looping tricks could raise this number, let's say</p>

<pre><code>$temp = "";
for($i = 0; $i &lt; UNBELIEVABLY_BIG_NUMBER; $i++) $temp .= "a";
echo $temp;
</code></pre>

<p>The code would break anyways at reaching the allowed memory allocable.</p>

<p>Is this correct? Now, is there any code you can write to change this limit?</p>

<p>And the other part of this question, is there a way to generate infinite output? By infinite I mean an output, what would constantly growing in the browser. What would be the shortest code to achieve that?</p>
