Re: Variable (naming them) Functions.

From: Date: Fri, 27 Apr 2001 17:47:34 +0000
Subject: Re: Variable (naming them) Functions.
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-50661@lists.php.net to get a copy of this message
On Friday 27 April 2001 17:08, PHPBeginner.com wrote: > no classes CAN'T solve my problem: > > it is an abstraction layer. called as func_hello(); I want, inside > func_hello() {} declare a new function based on what happened before > func_hello() was called. In other words: I of course though about > classes, and there is in fact a work around, but I need to know if > 'function $var($arg) { return; }' syntax exists and what it is. > > in the docs there's nothing being said. http://php.net/create_function (maybe together with a little wrapper: $foo = create_function (...); $FNames [$var] = $foo; function delta ($FuncName, $args) { return ${$FNames[$FuncName]} ($args); } ) But such a thing is an ugly hack and I'm sure you don't need it. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) Error 032: Recursion error - see error 032

« previous php.general (#50661) next »