On Sat, May 17, 2014 at 5:56 PM, Chanaka Dharmarathna <pe.chanaka.ck@gmail.com> wrote:
Hi All,

I'm just exploring the issues raised by scrutinizer. It raise issues like, variable is not initialized. Have a look at issue [0], complaining on code segment [1].

Personally I like to initialize variables, before using it, even a value is assigning at some point of the execution path. In this case we can initialized it like $x=array('foo');

As I remember Marc mentioned different thought on this kind of situation (at the LinuxTag booth). You may have good thoughts we should know.

So what we should do for this kind of issue ? Just ignore them since PHP does not force, or fix them ? Appreciate your thoughts.

Hi, IMHO, Yes, we should initialize them as per following convention (as it is a good practice):

$booleans = false;
$integers = 0;
$floats = 0.0;
$strings = '';
$array = array();

 
--
Regards,
Chirayu Chiripal
phpMyAdmin Intern - Google Summer of Code 2014
https://chirayuchiripal.wordpress.com/