Overwriting built-in functions
Moderator: General Moderators
- kendall
- Forum Regular
- Posts: 852
- Joined: Tue Jul 30, 2002 10:21 am
- Location: Trinidad, West Indies
- Contact:
Overwriting built-in functions
Hello,
I disabled a built-in function in my PHP.ini file in order to create my own custom function of the same name. But I get the error "Cannot redeclare function". How can this be if I have disabled the built-in function?
I don't have PECL
I disabled a built-in function in my PHP.ini file in order to create my own custom function of the same name. But I get the error "Cannot redeclare function". How can this be if I have disabled the built-in function?
I don't have PECL
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: Overwriting built-in functions
What do you mean you disabled a function? You disabled an extension that defines this function? What function?
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
- kendall
- Forum Regular
- Posts: 852
- Joined: Tue Jul 30, 2002 10:21 am
- Location: Trinidad, West Indies
- Contact:
Re: Overwriting built-in functions
i disable_functions = mime_content_typeAbraCadaver wrote:What do you mean you disabled a function? You disabled an extension that defines this function? What function?
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: Overwriting built-in functions
That just disables their use. The function is still defined.kendall wrote:i disable_functions = mime_content_typeAbraCadaver wrote:What do you mean you disabled a function? You disabled an extension that defines this function? What function?
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
- kendall
- Forum Regular
- Posts: 852
- Joined: Tue Jul 30, 2002 10:21 am
- Location: Trinidad, West Indies
- Contact:
Re: Overwriting built-in functions
Soooooo how do you remove it all together? the manual says its deprecated.AbraCadaver wrote:
That just disables their use. The function is still defined.
Re: Overwriting built-in functions
Not possible unless you recompile php.kendall wrote:Soooooo how do you remove it all together?
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: Overwriting built-in functions
It's deprecated in 5.3 which I think your going to need to use the fileinfo extension. It probably won't be removed until PHP 6. To remove it yourself you would need to find it in the PHP source code, comment it out and compile PHP yourself.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Re: Overwriting built-in functions
Or just rename your function to something else and save yourself a couple of days......
Re: Overwriting built-in functions
Yeah, in this situation I would usually create a class just to wrap the function, that way it will be easy to change in the future
Re: Overwriting built-in functions
And on another server that hasn't deleted a function from the PHP source code.
Re: Overwriting built-in functions
... or even easier
Why don't you rename your function to something else?
Why don't you rename your function to something else?