0
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 but 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 instantiated the stdClass
What must be done?
What version of php do you have running ? The
obj
has some use in the code above that shown ?– Isac
It’s not easier to do:
$obj = (object) $_POST;
?– rray