Re: [PHP] unsetting function

2002-05-29 Thread Steve Buehler

You might want to give an example of what you are trying to do or at least, 
why.  I am not an expert (not by a long ways), but to me, the way your 
question is worded, I would have to sayOpen up the page in whatever 
editing program you want to use delete the function and put in a new 
function that you want in its place.  It would make it easier if you used 
the same function name, or you will have to change all calls to it.

Steve

At 11:33 AM 5/29/2002 +0200, Laurent Drouet wrote:
Hi the ML

I would like to know if there is a way to unset a function or to replace
function contents by an other ?

Regards

Laurent


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


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



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




Re: [PHP] unsetting function

2002-05-29 Thread Miguel Cruz

On Wed, 29 May 2002, Laurent Drouet wrote:
 I would like to know if there is a way to unset a function or to replace
 function contents by an other ?

Not natively, that I know of.

If you think you'll have to do a lot of that, it's probably easier to keep 
the function name in a variable, and just change that when you want the 
function called to change.

?

  function add($a, $b) { return $a + $b; }
  function subtract($a, $b) { return $a - $b; }

  $mathfunc = 'add';
  print 'br' . $mathfunc(5, 3);

  // now we want to replace mathfunc so it subtracts instead of adds:
  $mathfunc = 'subtract';
  print 'br' . $mathfunc(5, 3);

?

miguel


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