RE: [PHP] Variable (naming them) Functions.

From: Date: Fri, 27 Apr 2001 16:42:06 +0000
Subject: RE: [PHP] Variable (naming them) Functions.
Groups: php.general 
Request: Send a blank email to php-general+get-50654@lists.php.net to get a copy of this message
It lets you choose the variable name which you use when referencing the function, but the actual function name is set by PHP (as lambda_1, lambda_2, etc.) <? $test="myFunction"; $$test = create_function('$a,$b','return log($a * $b);'); echo "myFunction is ".$myFunction(2,2)."<br>"; ?> Kirk > -----Original Message----- > From: PHPBeginner.com [mailto:php-general@phpbeginner.com] > Sent: Friday, April 27, 2001 10:27 AM > To: Johnson, Kirk; 'PHP General List. (E-mail)' > Subject: RE: [PHP] Variable (naming them) Functions. > > > create_function seems not letting you choosing it's name. > > am I right, or there's a way to say: > create_function($name.$to.be, args, > args, args....)? > > > Sincerely, > > Maxim Maletsky > Founder, Chief Developer > > PHPBeginner.com (Where PHP Begins) > maxim@phpbeginner.com > www.phpbeginner.com > > > > > -----Original Message----- > From: Johnson, Kirk [mailto:kjohnson@zootweb.com] > Sent: Saturday, April 28, 2001 1:03 AM > To: 'PHP General List. (E-mail)' > Subject: RE: [PHP] Variable (naming them) Functions. > > > Did you see create_function()? Not sure if this is what you > are after, but > http://www.php.net/manual/en/function.create-function.php > > Kirk > > > -----Original Message----- > > From: Maxim Maletsky [mailto:maxim.maletsky@japaninc.net] > > Subject: [PHP] Variable (naming them) Functions. > > > > Hello everyone: > > > > I was wondering, does anyone of you know a method to declare > > a function > > (give it a name) basing on a value acquired during run time? > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: > php-list-admin@lists.php.net > >

« previous php.general (#50654) next »