How safe is using .= operator on an uninitialized variable?

Posted by Pinki | Updated on

How safe is using .= operator on an uninitialized variable?

It is bad practice, which is why PHP will issue an E_NOTICE (if you enable error reporting).

That said, PHP variables are always initialized automatically so it won’t have any negative effect.


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers