When I create a standard class I mostly do:
$test = null;
$test->id = 1;
$test->name = 'name';
However in strict-mode I get an error.
So obviously the correct way of doing it is:
$test = new stdClass();
$test->id = 1;
$test->name = 'name';
So I am wondering:
Is it a big no-no to do: $test = null;
to do what I want?
What do we gain by conforming to the strict standards? Does it make sure code will keep on working in future versions? Will it be better backwards compatible? Is it just a matter of best practice? Something else?
EDIT typo
$text->name
when$text
doesn't exist at all... is telling. – Lenny