PhpStorm 2020.2 - PHP Built-in functions are not recognized
It's a known issue. AFAIK there is still no solid idea on why it happens and why only some users are affected.
https://youtrack.jetbrains.com/issue/WI-54626 -- watch this ticket (star/vote/comment) to get notified on any progress. Fixed in PhpStorm 2021.1.1 version.
Current workaround:
- Close IDE
- Locate folder where PhpStorm 2020.2 stores indexes/caches on your computer (see below)
- Delete that folder (as standard "Invalidate caches" does not help here)
- Launch IDE
Typical locations for caches folder for different OS:
- Windows:
%USERPROFILE%\AppData\Local\JetBrains\PhpStorm2020.2\caches
- Linux:
~/.cache/JetBrains/PhpStorm2020.2/caches
- macOS:
~/Library/Caches/JetBrains/PhpStorm2020.2/caches
For 2021.1 version: use File | Invalidate Caches...
-- it now better clears them so no need to delete such folders manually.
File | Invalidate Caches...
- Select top 2 options (maybe only 1st will be enough, but better use both)
- Use
Invalidate and Restart
button there - After the IDE will restart, open the project and let re-indexing to complete.
If the issue persists (i.e. comes back the next day / after restart) then it's a different cause and you will have to wait for 2021.1.1 build.
PhpStorm does not recognize PHP functions
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
My PhpStorm 5 does not know php native functions
Try File
| Invalidate Caches, also check that PHP interpreter is configured for the project (File
| Settings
| PHP
, Interpreter).
PhpStorm can't find DateTime
Comment from : @LazyOne fixed it for me
Check stackoverflow.com/a/64071021/783119
delete the chache folder: ~/.cache/JetBrains/PhpStorm2020.3/caches
PhpStorm not recognising core PHP
I believe we should consider some things here. What version of PHP are you using. Not all version of PHP supports Exception and the namespaces does matter except you are using a dependency manager which may come configured with its namespace but if you are building from scratch, you may want to consider the namespace and the version PHP
PhpStorm - remove 200 responses from console when using built in PHP server
Use Grep Console plugin for this -- should do the job fine (does so in similar consoles).
Based on your requirements it allows you to:
- change color for the matching text (or whole line if desired) based on presence of some marker (matching text)
- or even hide (filter out) such line completely.
Your marker here could be [200]:
for successful responses -- this is a simple "match the exact text" pattern. If it does not work (e.g. because this text is in the middle of the string .. or because it looks like regex (as []
have special meaning in regex)) then just convert it into proper regex: .*\[200\]:.*
-- something like that should do.
Example of how it works:
The rule for that is highlighted (plain string as it's a very simple rule -- match exact string):
Getting an “Undefined constant '__NAMESPACE__'” error in PhpStorm even after a namespace has been defined
I emailed JetBrains support and they got back to me with the fix and it is exactly what @LazyOne mentioned in the comments section above.
I simply deleted the following folder on my Mac and it resolved the issue:
~Library/Caches/JetBrains/PhpStorm2020.2
Related Topics
Any PHP Code to Detect the Browser with Version and Operating System
Why Doesn't Sprintf() Output Anything
How to Check If File Is Ascii or Binary in PHP
In PHP What Does |= Mean, That Is Pipe Equals (Not Exclamation)
Class Firebase\Jwt\Jwt Not Found
PHP Loop; How to Print Each Result and Delay It for a Second Before Echoing Another Result
Codeigniter Redirect -- the Uri You Submitted Has Disallowed Characters
Android: Uploading Image on Server with PHP
Using Seo User Friendly in PHP
PHP Eval That Evaluates HTML & PHP
I18N with Gettext But Without the Locale Hassle
JavaScript Cookies VS PHP Cookies
Why Does (0 == 'Hello') Return True in PHP
Laravel Form Methods VS Traditional Coding