get_mangled_object_vars showing in function suggestion list for PHP language level less than 7

I typed `get_` then hit Cmd+Space to see the suggestions to easily add the function I wanted (which I couldn't exactly remember), then noticed "get_mangled_object_vars" as a suggestion... example:

I looked this up online, yet got a strange result:

I then find this on another page: https://www.technolush.com/blog/whats-new-in-php-7-4

If I place the function then Cmd+click it to trace its definition, it shows this in file (Mac) /Applications/PhpStorm.app/Contents/plugins/php/lib/php.jar!/stubs/standard/standard_9.php:

As far as I know, that's based on PHP's actual documentation for defined functions in its source code, correct?

Now, even more strange, my PHPStorm > Preferences show PHP 5.5 as the language level:

I'm not running PHP from CLI either; just coding in the editor from the top-level repo folder (which is where the site's docroot starts too), so I don't understand what is going on here. The project servers are in PHP 5.5 (we can't upgrade right now, sorry), so I don't want PHP 7 functions showing in my suggest list.

I've already tried Invalidate Cache / Restart (in fact I do this multiple times a week now due to all of the new erratic buggy behavior in the updates to PHPStorm this year)... so do I just keep trying until it magically fixes it, or what am I missing?!

1 comment
Comment actions Permalink

In fact, setting a different PHP Language Level will not remove the unsupported function from the completion list but will enable an inspection warning if a function is not supported by the current Language Level set. 

As for the PHP official documentation, we all should admit that it is not always up-to-date and well maintained. That is true, this function is not documented, however, it is introduced on php.net doc site as well:

https://www.php.net/manual/en/migration74.new-functions.php (the page looks more like stub but nevertheless)

0

Please sign in to leave a comment.