I'm getting an error in my PHP code Strict Standards: Creating default object from empty value. The code I'm using is:
$u = new User();
$user->id = $obj['user_id'];
The error is appearing on the second line, where I set the id
property. The user class has id
set as a private property with magic getters and setters defined.
Strangely, the exact same code works without the strict error elsewhere - so my main question is exactly what the error means? Hopefully then I can deduce what the problem is with the code.