Re: Structured Code vs. Performance

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2007-11-29 at 12:13 +0000, Stut wrote:
>
> Not ;). There is no such thing as a compile-time definition in PHP.

There certainly is...

<?php

if( !function_exists( 'file_put_contents' ) )
{
    $def = <<<_
               
        function file_put_contents
        ( \$filename, \$data, \$flags=0, \$context=null )
        {
            // :)
        }
_;
  
    eval( $def );

}

?>

Now, I'm not necessarily advocating this style of compatibility
programming, but I remember seeing something like it in PEAR. I think it
might have been the pear SOAP classes where the classes had to be
declared dynamically.

Cheers,
Rob.
-- 
...........................................................
SwarmBuy.com - http://www.swarmbuy.com

    Leveraging the buying power of the masses!
...........................................................

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux