32 ms·
"if not defined" doesn't help, if your own `array_find` doesn't have the same signature and semantics than the new global then you're screwed. You'd want the op
by williamdclt 2y ago
"if not defined" doesn't help, if your own `array_find` doesn't have the same signature and semantics than the new global then you're screwed. You'd want the opposite: overwrite it if it already exists in the global scope (dunno if that's easy / how that'd work in PHP)
- asddubs 2y agothe answer is using a namespace
- nodogoto 2y agoYou can't redefine functions in PHP.
- mklepaczewski 2y agoThere are extensions which allow you to redefine even constants.
- someothherguyy 2y ago> `array_find` doesn't have the same signature and semantics than the new global then you're screwed Screwed? Just rename or move the function to a namespace in an IDE and it will update all your references?