Reputation: 2636
I would like to use:
function list(args);
but list
is a reserved word.
Can I remove the list function from PHP, disable it, or otherwise?
Upvotes: 0
Views: 2653
Reputation: 400932
In a normal situation, no, you cannot remove a function.
Using the runkit extension (which I've virtually never seen installed on a server -- and absolutely never on a production server !), you'd have the runkit_function_remove()
function, that could help.
Same with other debugging extensions, such as APD, which provides the override_function()
, btw.
Upvotes: 6
Reputation: 212412
You can only rename/remove core functions using the runkit or APD extensions. list isn't actually a function, but a language construct, so you can't rename it even with those extensions.
You should really be using a better choice of names for your own functions... list() isn't particularly meaningful. list what?
Upvotes: 5
Reputation: 239260
No, you can't, nor should you want to. Redefining built-in functions is a Bad Thing, especially something as fundamental as list
, which isn't a function at all - it's a language construct.
All you can do is come up with a unique name for your function.
Upvotes: 10