Answer the question
In order to leave comments, you need to log in
Why if I wrap file_get_contents in a function PhpStorm doesn't see $http_response_header?
Hello! There is this code:
<?php
$url = 'https://toster.ru/';
const WITH_WRAP = 1;
const WITHOUT_WRAP = 2;
$mode = WITHOUT_WRAP;
function some_func($url) {
$result = file_get_contents($url);
var_dump($http_response_header);
}
switch ($mode) {
case WITH_WRAP:
some_func($url);
break;
case WITHOUT_WRAP:
$result = file_get_contents($url);
var_dump($http_response_header);
break;
}
var_dump($http_response_header);
var_dump($http_response_header);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question