What does PHP do with deprecated functions?

Deperecated functions still exist and you get the warning. So they work as expected. However in a future version they might disappear.

That’s the same for other deprecated language features which you sometimes get notices about. It’s a way to signal changes to users which have code based on an older PHP version.

Normally the deprecated features get removed after some time, but it’s not predictable how long this takes. I know of at least one case where a once deprecated feature was un-deprecated later on. However, I think that’s exceptional.

So if you see these warnings, update the code. Most often the PHP documentation has more information why something has been deprecated and what to do. Most often it’s an improvement (e.g. in security), so you really should deal with these warnings if you care about the code.

Edit: I think it’s noteworthy in this context to look for strict standards notices PHP Manual as well. They are somewhat related because these notices are useful hints for changes in the language as well.

Enabling E_STRICT during development has some benefits. STRICT messages will help you to use the latest and greatest suggested method of coding, for example warn you about using deprecated functions.

(from the PHP Manual link above)

Leave a Comment