user318466
user318466

Reputation: 423

How do I disable a function(s) from usage in PHP?

I wanted to know the way to disable a function from usage in PHP.

Thanks

Upvotes: 7

Views: 3022

Answers (3)

Gaurav Srivastava
Gaurav Srivastava

Reputation: 363

you may try to override that function to do nothing

http://php.net/manual/en/function.override-function.php

Upvotes: 0

Luis
Luis

Reputation: 6001

If you can give me more details, like what you are trying to do maybe we can provide a better solution. To answer your query if you want to disable a function this should do:

override_function('test', '', '');

this will override function test with a function that does nothing.

Upvotes: 0

Dumb Guy
Dumb Guy

Reputation: 3446

In the php.ini configuration file, you can use the disable_functions parameter. For example, to disable the symlink() and system() functions, you would use:

disable_functions = "symlink,system"

Upvotes: 21

Related Questions