Date: 06/30/99
- Next message: cab <email protected>: "[PHP-DEV] Bug #1638: SPARCworks cc warnings (cosmetic)"
- Previous message: jim: "[PHP-DEV] CVS update: php3"
- In reply to: Zeev Suraski: "Re: [PHP-DEV] Object method as handler functions in PHP4/Zend"
- Next in thread: Jim Winstead: "Re: [PHP-DEV] Object method as handler functions in PHP4/Zend"
- Reply: Jim Winstead: "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 ]
Quoting Zeev Suraski <zeev <email protected>>:
> If you know you're expecting an object context, make your function accept
> $obj and $method, and inside the function, call $method() if $obj is empty,
> or $obj->$method() if it isn't.
Would it be possible to add an optional argument specifying an object
reference to all of the functions that take a function name as a parameter
(array_walk, usort, etc).
This would allow you to write:
mysort($a, $b, $obj) {}
and call:
$foo = usort($bar, 'mysort', $foo_object);
This at least lets you avoid setting global variables for mysort() to access
before calling usort.
-chuck
-- Charles Hagenbuch, <chagenbu <email protected>> -- must... find... acorns... *thud*-- 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: cab <email protected>: "[PHP-DEV] Bug #1638: SPARCworks cc warnings (cosmetic)"
- Previous message: jim: "[PHP-DEV] CVS update: php3"
- In reply to: Zeev Suraski: "Re: [PHP-DEV] Object method as handler functions in PHP4/Zend"
- Next in thread: Jim Winstead: "Re: [PHP-DEV] Object method as handler functions in PHP4/Zend"
- Reply: Jim Winstead: "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 ]

