views:

179

answers:

3

I have E_NOTICE activated in php.ini. It still does not warn me about unassigned values like

$foo++;

Tried to set the error_reporting as well. Does not work. error_reporting() is set to 6143, which means that E_NOTICE is activated. This code snippet also warns me with a notice:

$foo = bar;

Any ideas?

A: 

It works for me in PHP Version 5.2.8

Notice: Undefined variable: foo

<?php

error_reporting(E_ALL | E_NOTICE);  // Also works with 6143
$foo++;

?>
Greg
+2  A: 

That should cause an error message. Perhaps it is caused by registering an error handler which incorrectly swallows all errors? Such as

function error_handler($error_number  /*, ... */) {
    // do stuff...
    return true;
}
Øystein Riiser Gundersen
I do have in fact a registered error_handler. But even if I do not set the error_handler, I don't get a notice. Very strange.I have php 5.2.10
2ni
A: 

After altering the file php.ini. you should restart the php/apache services.

codymanix
I know + I did :-(
2ni