stdclass - PHP strict standards: is this bad? -


when create standard class do:

$test = null; $test->id = 1; $test->name = 'name'; 

however in strict-mode error.

so correct way of doing is:

$test = new stdclass(); $test->id = 1; $test->name = 'name'; 

so wondering:

is big no-no do: $test = null; want?

what gain conforming strict standards? make sure code keep on working in future versions? better backwards compatible? matter of best practice? else?

edit typo

is big no-no do: $test = null; want?

yes.

it's allowed because php loose, turning on strict mode gives god's-honest truth.

what gain conforming strict standards? make sure code keep on working in future versions? better backwards compatible? matter of best practice?

yes.

something else?

it's right.


Comments

Popular posts from this blog

javascript - Iterate over array and calculate average values of array-parts -

php - Time zone issue -

iphone - Using nested NSDictionary with Picker -