Re: function as arguments to functions(constructors)

From: Date: Wed, 26 Jul 2000 06:40:36 +0000
Subject: Re: function as arguments to functions(constructors)
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-8214@lists.php.net to get a copy of this message
Dennis, have you taken a look at call_user_func()? It might be what you are looking for. Charles ----- Original Message ----- From: "Dennis Gearon" <gearond@cvc.net> To: <php-general@lists.php.net> Sent: Tuesday, July 25, 2000 10:58 PM Subject: [PHP] function as arguments to functions(constructors) > I was wondering if you could tell me if it is possible to pass a global > function as an argument to a class constructor, and if so, how? > > I have made a building block/class that is a 'SafeTypedSTR'. > (SafeAndTypedString(tm)). I want to supply the typing function upon > instantiation. In essence, it has the following "public" functions: > PutSafe(), GetSafe(), Validate(). > > And it has the following "private" function identifier, which I wish to > assign the external, public typing function to: TypingFunc(). {I would > use a funcptr in C++/Java} > > Some examples of it's use would be: > URL-strings.( instantiate with URLConforms($str) ) > DB-strings.( instantiate with StrDBSafe($str) ) > PGP-strings.( instantiate with PGPConforms($str) ) > EMAIL-strings.( instantiate with EMAILConforms($str) ) > PhyADDR-strings ( instantiate with PHYADDRConforms($str) ) > FILENAME-strings ( instantiate with FILENAMEConforms($str) ) > PHONUM-strings( instantiate with PHONUMConforms($str) ) > > I also want the 'typing function' to be in the public namespace in order > to be able to use it in other places. > > > > -- > ----------------------------------------------------------------- > Time Spent With Your Dog(Kid) is Time Well Spent > ----------------------------------------------------------------- > Sincerely, Dennis Gearon > > > > -- > 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 (#8214) next »