I have the following php code
$obj = new \stdClass;
foreach($_GET as $key => $value) {
$obj->get->$key = $value;
}
foreach($_POST as $key => $value) {
$obj->post->$key = $value;
}
return $obj;
The code works normally however the php warning
Warning: Creating default object from empty value in C: \ Users \ User \ Desktop \ loren \ core \ Route.php on line 31
continues to be shown even though I instantiating stdClass
What should be done?