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