Code inspection doesn't seem to find all php deprecated items
I'm trying out the product right now to see if it can help me migrate code from a PHP 5.3 environment to a newer PHP 7 environment. Over the years we've had various people and none have updated the code, now they are gone and I'm stuck with it landing on my plate.
I know for a fact there is deprecated code like $HTTP_SERVER_VARS and $HTTP_POST_VARS in use, but so far I haven't been able to get PhpStorm to flag any of those.
I've tried setting the PHP Language Level to 7.0, 7.1, 7.2 and it doesn't flag those known items. I do not have the PHP Composer synchronizing the IDE settings with composer.json that option is unchecked.
I've tried Run Inspection by Name and used Language Level, I just get a result of "No suspicious code found".
When doing a normal Inspect Code, it finds some PHP General Deprecated items, but those are mainly mysql database functions...neither of the ones I named above show up.
Am I doing something wrong? Do I need to set the PHP Language Level to something like 5.5 first?
I'd like to be able to use a tool like this to help, rather than sit there looking at my Apache error log and loading pages and waiting to see a Deprecated entry show up in an error log...and then fixing that, and doing it again to try and identify all of these items.
Thanks,
Scott
Please sign in to leave a comment.
You're doing nothing wrong, there's just no inspection for these supreglobals, no one has asked for them.
The language level inspection that provides compatibility checks is not full and can miss some stuff.
If you think it's worth adding, please submit a feature request: https://youtrack.jetbrains.com/newIssue?project=WI
Eugene, thanks for the reply and the information. Knowing that it wasn't setup to inspect for those types of superglobals helps. I know the program is identifying other things for me, I was just unsure why it wasn't identifying a few things I knew were deprecated.
Thanks again.