Немного поэкспериментировал с E_STRICT, и вот какую странную особенность заметил:
PHP:
//Test.php:
<?php
error_reporting(E_ALL|E_STRICT); // Это будем менять
class MyClass
{
var $MyVar; // Strict Standards: var: Deprecated. Please use the public/private/protected...
}
$MyObject=new MyClass();
function &MyFunction()
{
return 1+1; // Strict Standards: Only variable references should be returned by reference
}
$MyVar1=&MyFunction();
?>
Ситация 1
Test.php : error_reporting(E_ALL|E_STRICT);
php.ini : error_reporting = E_ALL|E_STRICT
Результат : Strict Standards: var: Deprecated. Please use the public/private/protected modifiers
Strict Standards: Only variable references should be returned by reference
(ОК)
Ситуация 2
Test.php : error_reporting(E_ALL);
php.ini : error_reporting = E_ALL
Результат : Пусто
(ОК)
Ситуация 3
Test.php : error_reporting(E_ALL|E_STRICT);
php.ini : error_reporting = E_ALL
Результат : Strict Standards: Only variable references should be returned by reference
(FAIL: Где "Strict Standards: var: Deprecated. Please use the public/private/protected modifiers" ?)
Ситуация 4
Test.php : error_reporting(E_ALL);
php.ini : error_reporting = E_ALL|E_STRICT
Результат : Strict Standards: var: Deprecated. Please use the public/private/protected modifiers
(FAIL: Откуда "Strict Standards" ?, я же его отменил)
Примечание: В принципе E_ALL можно опустить, не принципиально.
Вот из-за этого странного обстоятельства "myErrorHandling" необрабатывает
"Strict Standards: var: Deprecated. Please use the public/private/protected modifiers" , и нормально обрабатывает
"Strict Standards: Only variable references should be returned by reference" .
Кто мне это поеснит?
Либо я торможу, Либо Глюк...
Либо так задумано: что часть E_STRICT не попадает под действие ни
error_reporting(); ни
"myErrorHandling", а другая часть ведет себя как надо.
---------------------------------------------------
PHP 5.0.3