If somewhere inside a script I am doing the following [PHP]$myvar ++;[/PHP]
Does it make any difference whether I initialise the variable
[PHP]$myvar = '';
or
$myvar = 0;[/PHP] I come from a C/C++ background which would fall over if you triied to add one to an empty string.
If php debugging is set to STRICT,
a warning is generated if an attempt to increment a non declared variable is made.
I try to write robust code and find it hard to accept there is no potential problem here
Does it make any difference whether I initialise the variable
[PHP]$myvar = '';
or
$myvar = 0;[/PHP] I come from a C/C++ background which would fall over if you triied to add one to an empty string.
If php debugging is set to STRICT,
a warning is generated if an attempt to increment a non declared variable is made.
I try to write robust code and find it hard to accept there is no potential problem here
Comment