[Vtigercrm-developers] A question on efficiency/semantics...
Alan Lord
alanslists at gmail.com
Wed May 5 15:36:38 GMT 2021
Interesting.
That seems like good/valid Warning - it should encourage the declaration
of variables at the start of each routine.
Maybe for a variable variable it might not make sense but those aren't
that common it seems to me?
Nice to hear from you Joe. Hope all's well.
Cheers
Al
On 05/05/2021 16:24, Joe Bordes wrote:
> Sadly, PHP warning system doesn't work that way:
>
> ----
>
> <?php
> error_reporting(-1);
> ini_set('display_errors', 1);
>
> if ($nothere) {
> echo "it is here";
> } else {
> echo "it isn't here";
> }
> -----
>
> result
>
> -----
>
> joe at linuxmint:/var/www/coreBOSTest$ php k.php
> PHP Notice: Undefined variable: nothere in /var/www/coreBOSTest/k.php
> on line 5
> PHP Stack trace:
> PHP 1. {main}() /var/www/coreBOSTest/k.php:0
>
> Notice: Undefined variable: nothere in /var/www/coreBOSTest/k.php on line 5
>
> Call Stack:
> 0.0001 393600 1. {main}() /var/www/coreBOSTest/k.php:0
>
> it isn't here
>
> ------
>
>
> so you get the warning if the variable is not defined which is what you
> are trying to avoid
>
More information about the vtigercrm-developers
mailing list