php - Foreach loop in PhpStorm


It works in online PHP compiler but doesn't work on my local. It also doesn't work with other arrays (not only with$_SERVER). I see red mark on the right side at the line whereforeach loop wrote

PhpStorm suggests to write beforeforeach something like:

/** @var TYPE_NAME $v */

but it also doesn't help at all.

I've tried to turn off all boxes in PHPDoc settings.

foreach ($_SERVER as $k => $v){
    echo "$k => $v <br>";

I expect that$_SERVER array prints in browser.

People are also looking for solutions to the problem: Unable to extract token from url in php


Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.