4 ms·
PHP doesn't allow you to pass functions and classes as arguments.
by ceol 15y ago
PHP doesn't allow you to pass functions and classes as arguments.
- cgdangelo 15y agoUnless I'm misunderstanding you, passing functions as arguments is definitely possible with anonymous functions/closures.
- Gigablah 15y agoYou can. Here's my code as an example: https://github.com/gigablah/fsphinxphp/blob/master/src/FSphinx/FSphinxClient.php#L271 https://github.com/gigablah/fsphinxphp/blob/master/src/FSphi... Note the $getter parameter.