[Phpmyadmin-devel] Initialize or Not
Chirayu Chiripal
chirayu.chiripal at gmail.com
Sat May 17 14:53:05 CEST 2014
On Sat, May 17, 2014 at 5:56 PM, Chanaka Dharmarathna <
pe.chanaka.ck at 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();
> [0] : http://goo.gl/HNW8Be
> [1] : http://goo.gl/vUj25O
>
> Regards !
> --
> Chanaka Dharmarathna
> *http://chanakaindrajith.blogspot.com/*<http://chanakaindrajith.blogspot.com/>
>
>
--
Regards,
Chirayu Chiripal
phpMyAdmin Intern - Google Summer of Code 2014
https://chirayuchiripal.wordpress.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.phpmyadmin.net/pipermail/developers/attachments/20140517/65d09434/attachment.html>
More information about the Developers
mailing list