[Phpmyadmin-devel] Initialize or Not

Hugues Peccatte hugues.peccatte at gmail.com
Sat May 17 14:41:20 CEST 2014


2014-05-17 14:26 GMT+02:00 Chanaka Dharmarathna <pe.chanaka.ck at gmail.com>:

> 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.
>
> [0] : http://goo.gl/HNW8Be
> [1] : http://goo.gl/vUj25O
>
> Regards !
> --
> Chanaka Dharmarathna
>

Hi,

I think this is better to "fix" them. Because it is always difficult to
know the behavior of PHP in this case. And what could happen in next
version if they decide to change this behavior?
I really don't like to let IT decides itself how it should behave. :)

If I find this kind of code, I wouldn't ask and fix it immediatly.

Hugues.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.phpmyadmin.net/pipermail/developers/attachments/20140517/189b24bd/attachment.html>


More information about the Developers mailing list