Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PhpStorm Warnings on JSON functions

Tags:

json

php

phpstorm

I'm using PhpStorm 7.1.3.

Whenever I use on of the PHP-built-in functions json_encode or json_decode PhpStorm says that this function is undefined.

here's a screenshot

I don't want to disable inspection for all undeclared functions. I also don't want to supress the inspection for every statement including json_*.

What's the easiest way to get rid of these warnings? Why do they even show up?

like image 258
Johann Bauer Avatar asked Feb 12 '23 14:02

Johann Bauer


2 Answers

Your indexes may have been corrupted somehow (for whatever reason, e.g. crash/improper shutdown) or are simply out of date (in case of upgrade from previous version).

Please use File | Invalidate caches... and restart IDE.

like image 164
LazyOne Avatar answered Feb 15 '23 10:02

LazyOne


For me the solution was to check this box:enter image description here

like image 33
Ben Creasy Avatar answered Feb 15 '23 10:02

Ben Creasy