Re: Object method as handler functions in PHP4/Zend

From: Date: Tue, 29 Jun 1999 20:35:51 +0000
Subject: Re: Object method as handler functions in PHP4/Zend
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-7846@lists.php.net to get a copy of this message
Hello Zeev, On 29-Jun-99 20:26:30, you wrote: >You can call an object method from outside an object in PHP 4.0, using the >notation of >classname::method(). >Right now, only static strings are accepted for both the class name and the >method name, but we may make them dynamic so that you can this notation >indirectly. That's better, but I don't know if that solves the reentrancy problem. I'm not sure what you mean by dynamic, but I hope that means you can pass a string as name of a callback function and the function is called in the context of a user defined object of a given class. Thatr would mean that the $this references in the method function reference the functions of the class and the variables of the user defined object. >At 15:39 29/06/99 , Andrey Zmievski wrote: >>Manuel Lemos wrote: >> > Unfortunately, some core PHP functions take names of global functions >> > parameters for callback handlers. I say unfortunately because sometimes >> > I need to have a callback function to call a method of a given object, >> > and >>since >> > currently there is no way to specify a object method as call back handler >> > function, I have to use a global stub function. >> > >> > This is not good because I need have access to context that is provided >> > by the object, so I have resort to global variables. For those that >> > question it, global variables are not bad just because a programming >> > teached said so, but because: >> >>Good call, Manuel. This is exactly the kind of functionality I also wished >>we had in PHP. >> >>-Andrey >>* 2 + 2 = 5 for extremely large values of 2. * >-- >Zeev Suraski <zeev@zend.com> http://www.zend.com/ >For a PGP public key, finger bourbon@netvision.net.il >-- >PHP Development Mailing List (http://www.php.net/) >To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net >For additional commands, e-mail: php-dev-help@lists.php.net >To contact the list administrators, e-mail: php-list-admin@lists.php.net Regards, Manuel Lemos Web Programming Components using PHP Classes. Look at: http://phpclasses.UpperDesign.com/ -- E-mail: mlemos@acm.org URL: http://www.mlemos.e-na.net/ PGP key: finger://mlemos@zeus.ci.ua.pt --

« previous php.dev (#7846) next »