I recently ported from XAMPP, to the latest WAMP Version. All the codes from the previous server work fine, in particular, displaying Null values.
In XAMPP:
echo $a;
If $a is not yet declared, the system just prints nothing.
However,
in WAMP
echo $a;
If $a is not yet declared, the system gives an error `Undefined Variable`.
I checked my php.ini configuration files and httpd.conf but still, I can’t get the new version to display the null values.
QUESTION:
Is there anyway in the config to make php display the null values without declaring it or anything?
PS:
the XAMPP we use is 1.7.3
the WAMP i use now is 2.2e
Please do help. Thank you. 🙂
Its probably a PHP setting for the PHP error level.
PHP only shows undefined variables when PHP Notices are enabled.
XAMPP probably doesn’t enable PHP notices by default whereas WAMP most likely does.
To make WAMP not output undefined variable, open php.ini and change ‘error_reporting’ to:
This should tell PHP to output all errors except notices.