E_NOTICE atanmamış değerleri hakkında uyarmak değil

3 Cevap php

Ben E_NOTICE php.ini aktive var. Hala gibi atanmamış değerlerin bana uyarmak değil

$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;

Herhangi bir fikir?

3 Cevap

Bu bir hata mesajı neden olmalıdır. Belki de yanlış tüm hataları yutar bir hata işleyicisi kayıt neden olur? Gibi

function error_handler($error_number  /*, ... */) {
    // do stuff...
    return true;
}

PHP Version 5.2.8 benim için çalışıyor

Uyarı: Undefined variable: foo

<?php

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

?>

Dosya php.ini değiştirerek sonra. Eğer php / apache hizmetlerini yeniden başlatmanız gerekir.