Quantcast
Viewing all articles
Browse latest Browse all 2

Create Callbacks Using __invoke

The __invoke magic method (available as of PHP 5.3) is used to make an object callable as if it were a regular function. The combines the usefulness of objects with the simplicity of functions. One application of this feature is creating callback functions that can be passed around like objects. This is common practice in [...]

Viewing all articles
Browse latest Browse all 2

Trending Articles