<?php
var_dump($_SERVER);//data is ok
require_once __DIR__.'/Request.php';
$theReqeust = new \chenfa\Request();
Request.php code:
<?php
namespace chenfa;
class Request{
public function __construct()
{
var_dump($_SERVER);//null
var_dump($_GET);//null
var_dump($_REQUEST);//null
var_dump($_COOKIE);//null
}
}
index.php code:
Request.php code: