0

PhpStorm does not recognize PHP built in functions like count(), urldecode(), str_replace() etc. So many annoying warnings shows on each file & auto_complete does not work.

PhpStorm v2020.3

I've tried Invalidate caches / restart, deleting PhpStorm cache folder and also disabled all 3rd party plugins. But this problem exists yet.

Any suggestion would be appreciated.

enter image description here

7
  • 1
    This looks like a namespace issue. What happens if you write \str_replace? Commented Apr 27, 2021 at 18:16
  • 3
    See stackoverflow.com/a/64071021/783119 -- fixed properly in 2021.1.1. For 2020.3 only manual deletion of the cache/index folders helps Commented Apr 27, 2021 at 18:16
  • @Barmar Nothing happens! Commented Apr 27, 2021 at 18:28
  • See the linked question, that's probably it. Commented Apr 27, 2021 at 18:29
  • 1
    @SeyedAmirKhalifehSoltani 1) So what did you do exactly? Step by step (in case something was missing). What paths were used. 2) Try 2021.1.1 version Commented Apr 27, 2021 at 19:19

1 Answer 1

0

I found the reason. PhpStorm Php interpreter did not set correctly. After set interpreter and delete manually "caches" & "index" folders and restart Phpstorm it fixed successfully!

C:\Users{my_user}\AppData\Local\JetBrains\PhpStorm2020.3\caches C:\Users{my_user}\AppData\Local\JetBrains\PhpStorm2020.3\index

Sign up to request clarification or add additional context in comments.

1 Comment

That's unexpected. Perhaps there is a bug .. as you do not need an actual PHP Interpreter for writing PHP code (unless it's a bug, of course). My guess* is that it may be related to the bad selection of stub files (by mistake or whatnot) on PHP Runtime tab (a tab next to PHP Interpreter selector) -- they define what PHP core functions/classes/etc are known to the IDE.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.