I would like to override the _() PHP function so that it supports one or more arguments. Is it possible to do that using PHP code?
No, but with PHP version >= 5.3.0 you could use namespacing though.
It is possible, using the Runkit extension.
However, it's generally not considered a good idea, except for use with things like unit testing, where you may want to isolate some of your functionality.
For general use, you shouldn't be overriding built-in functions because it makes your code harder to maintain, and opens you up to some very hard to debug issues.
Also, the Runkit extension is marked as 'experimental', which means it really shouldn't be used in a production system.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With