Date: 06/29/99
- Next message: Chuck Hagenbuch: "Re: [PHP-DEV] Object method as handler functions in PHP4/Zend"
- Previous message: Ben Gunter: "[PHP-DEV] Re: Bug #1629 Updated: for x undefined values in an array, implode concatenates the last x + 1 items"
- In reply to: Zeev Suraski: "Re: [PHP-DEV] Object method as handler functions in PHP4/Zend"
- Next in thread: Zeev Suraski: "Re: [PHP-DEV] Object method as handler functions in PHP4/Zend"
- Reply: Zeev Suraski: "Re: [PHP-DEV] Object method as handler functions in PHP4/Zend"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hello Zeev,
On 30-Jun-99 05:24:09, 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.
>No, it doesn't mean that (I was talking about methods that don't really
>have object contexts). Frankly, I'm not really sure what you're after.
>You can pass that function a 'pointer' to an object, and a method name, and
>call $object->$method(). I think you could do that in PHP 3.0, but if you
>couldn't, you can do it using PHP 4.0.
Well, to present an example that you may understand right away, think of a
class that is used to parse a specific XML format. Ideally you would use
the class methods as the parser's XML element and data handlers and use
that variables of the object to store some format specific contextual
information.
In PHP 3 you can't use the class method functions as handlers. From what
you say, that is possible in PHP 4, but you still can't store the object
variables to store parsing contextual information.
What I am after is some way to pass to the XML functions that set the
handler functions, some reference that would let the XML parser call the
class methods in the context of a given object. Was this clear enough?
Regards,
Manuel Lemos
Web Programming Components using PHP Classes.
Look at: http://phpclasses.UpperDesign.com/
-- E-mail: mlemos <email protected> URL: http://www.mlemos.e-na.net/ PGP key: finger://mlemos <email protected> ---- PHP Development Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Chuck Hagenbuch: "Re: [PHP-DEV] Object method as handler functions in PHP4/Zend"
- Previous message: Ben Gunter: "[PHP-DEV] Re: Bug #1629 Updated: for x undefined values in an array, implode concatenates the last x + 1 items"
- In reply to: Zeev Suraski: "Re: [PHP-DEV] Object method as handler functions in PHP4/Zend"
- Next in thread: Zeev Suraski: "Re: [PHP-DEV] Object method as handler functions in PHP4/Zend"
- Reply: Zeev Suraski: "Re: [PHP-DEV] Object method as handler functions in PHP4/Zend"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

