Skip to content
Advertisement

How to add a new method to a php object on the fly?

How do I add a new method to an object “on the fly”?

JavaScript

Advertisement

Answer

You can harness __call for this:

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement