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

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -