This reminds me of whatever reason of this scene:
Like Occam tried to explain, often the simple answer is correct. If a function is not defined in your environment, and it was introduced in a certain version, and you assume you're using that version, then your assumption is probably wrong. It's not a question of other code doing something mysterious, it's just the wrong version. And, like you've learned, don't assume that something you see in one environment (a console shell) is the same as in another environment (a web server).