note 34012 deleted from function.register-shutdown-function by sniper
| From: | sniper@php.net | Date: | Thu, 06 Nov 2003 20:24:33 +0000 |
| Subject: | note 34012 deleted from function.register-shutdown-function by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-60021@lists.php.net to get a copy of this message | ||
Note Submitter: bishop
----
Need to call a static method with register_shutdown_function()?
This won't work:
register_shutdown_function('MyClass::MyMethod');
This will (obviously):
register_shutdown_function(create_function('', 'return MyClass::MyMethod();'));
Lambdas ("anonymous functions") are useful for all functions that take callbacks, so use
them creatively!