Translate Java code to PHP code (13 lines)
<p><a href="http://stackoverflow.com/questions/1351828/combinatorics-building-10-groups-of-100-elements-while-elements-remain-sorted">simonn helped me to code an ordered integer partition function here.</a> He posted two functions: one function simply gives back the count of partitions, the second function gives the partitions as a list.</p>

<p>I've already managed to translate the first function from Java to PHP:</p>

<ul>
<li><a href="http://paste.bradleygill.com/index.php?paste%5Fid=15870" rel="nofollow">Java version</a></li>
<li><a href="http://paste.bradleygill.com/index.php?paste%5Fid=15770" rel="nofollow">PHP version</a></li>
</ul>

<p>Unfortunately, I can't manage to translate the second function. Can anyone help me and translate this small function for me?</p>

<pre><code>public class Partitions2
{
    private static void showPartitions(int sizeSet, int numPartitions)
    {
        showPartitions("", 0, sizeSet, numPartitions);
    }

    private static void showPartitions(String prefix, int start, int finish,
                int numLeft)
    {
        if (numLeft == 0 &amp;&amp; start == finish) {
                System.out.println(prefix);
        } else {
                prefix += "|";
                for (int i = start + 1; i &lt;= finish; i++) {
                        prefix += i + ",";
                        showPartitions(prefix, i, finish, numLeft - 1);
                }
        }
    }

    public static void main(String[] args)
    {
        showPartitions(5, 3);
    }
}
</code></pre>

<p>It would be great if the solution would be one single function instead of a class with several functions.</p>

<p>Thank you very much in advance! And thanks again to simonn for this great answer!</p>
