Re: PHP and #if

From: Date: Fri, 14 Mar 2008 19:10:46 +0000
Subject: Re: PHP and #if
References: 1 2 3 4 5 6 7  Groups: php.general 
Request: Send a blank email to php-general+get-271609@lists.php.net to get a copy of this message
On 14 Mar 2008, at 19:03, Eric Gorr wrote:
Unfortunately, such things cannot be used to wrap functions.
Erm, yes they can. Try it. <?php
    if (rand(0,1) == 0)
    {
        function arse()
        {
            echo "arse 1\n";
        }
    }
    else
    {
        function arse()
        {
            echo "arse 2\n";
        }
    }
    arse();
?> Oh, and top-posting is evil, please don't do it. -Stut -- http://stut.net/

« previous php.general (#271609) next »