At 15:57 18.11.2002, Martin Magnusson spoke out and said:
>I installed php 4.2.3 on Apache2.
>When I write <? echo $anyvariable; ?> I get an error message telling me that
>I have an undefined variable $anyvariable. Is this something new that one
>must declare all variables?
>In my previous version of php the expression above would return an empty
>string - no error messages...

This is defined by the setting of error_reporting in your php.ini file.
What you get is not an error but a notice message that you are using an
undefined variable.

This can be handy if you want to spot the error when your script doesn't
behave like it should... anyway, to turn it off:

- in php.ini:
  error_reporting = E_ALL & ~E_NOTICE

- in your script:
  error_reporting(E_ALL & ~E_NOTICE);

- avoiding this:
  if (isset($anyvariable)) echo $anyvariable;

   >O Ernest E. Vogelsinger 
   (\) ICQ #13394035 

Reply via email to