When I create a standard class, I basically do:
$test = null;
$test->id = 1;
$test->name = 'name';
However, in strict mode, I get an error message.
Therefore, obviously, the correct way to do this is:
$test = new stdClass();
$test->id = 1;
$test->name = 'name';
Therefore, I wonder:
This is a big no-no-do: $test = null;do what I want?
What do we get by following strict standards? Does it ensure that the code will work in future versions? Would it be better backwards compatible? Is this just a matter of best practice? Something else?
EDIT
typo
source
share