Jump to content

Outdated/deprecated functions


macfanpl

Recommended Posts

VSCode on Mac

Coding in PHP file. When typing, InteliSense (or SSA) follows the cursor and display hints.

Seems ok, but it displays many names that, once inserted into code, get strike-through (meaning they are deprecated.

Would not be easier to remove them from IntelliSense rather than confusing others?

When coding in other languages, deprecated names does not appear in IS. Its php-specific issue.

Link to comment
Share on other sites

Apparently the author of whatever PHP language server extension you're using decided that their list would show deprecated items and give you the choice of whether you used them. If you don't like that, see if there's a setting to hide them.

Link to comment
Share on other sites

The rationale is that even though they are deprecated, they are technically still available to be used and someone may want/need to use them.

I've used various libraries in the past that have created a new API and deprecated their old one.  Usually updating to the new API isn't something that can be done right away so when I need to work on that code I'll need to continue to use those deprecated functions for a while.

Not sure about VSCode but PHPStorm shows such functions with a strike-out in the autocomplete popup as well so you know right away that the function is deprecated.  That lets you easily avoid them in new code but still have access to them when maintaining existing code.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.