|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Undefined variables but no error generated - Resolved
Hi, I have recently installed php 5.2.2.
Previously I was using version 4.x In 4.x, if I accessed a variable that was not defined then I would get an error. But now I can have undefined variables and I get no error. For example, If I put this line in my script $a = $b; Then i expect an error because $b does not exist. My php.ini file contains the following settings which are the same as the php.ini that I used with php4.x error_reporting = E_ALL & ~E_NOTICE display_errors = On So there must be some other switch to control this type of error detection and reporting. Help appreciated. Thanks. Last edited by downunder : October 6th, 2007 at 08:16 PM. Reason: Added word resolved |
|
#2
|
||||
|
||||
|
An undefined variable generates a NOTICE level message. The error_reporting setting you posted specifically turns off notice level messages.
If you were receiving notice messages with that setting, then either the php.ini where that setting was located was not being used by php or there was another setting that was overriding that setting. For your current want to display notice level messages, change the setting to: error_reporting = E_ALL Stop and start your web server to get any changes made to php.ini to take effect. |
|
#3
|
|||
|
|||
|
Fixed - Thank You
change the setting to: error_reporting = E_ALL
Worked a treat. Too obvious. I dont know why I did not see it. Thanks |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Installation > Undefined variables but no error generated |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|
|