[PHP-users 28502] error_reportingを0に設定してもDB.phpでE_STRICTが検出される

Kazunori Ito ito @ isp21.co.jp
2006年 2月 20日 (月) 22:59:07 JST


伊藤といいます。


PEAR DBを使用して、アプリを開発していますが、
「set_error_handler」を用いたエラー処理を加えた際に
以下のような現象が出て困っています。

サンプルソース
--------------------------------------------------------
function error_handler ($errno, $errmsg, $filename, $linenum, $vars)
{
	echo $errno . " >> " . $errmsg . " >> " . $filename . " >> " . $linenum .
"<BR>";
}

print 'error_reporting = ' . ini_get('error_reporting') . "<BR>";
error_reporting(0);
print 'error_reporting = ' . ini_get('error_reporting') . "<BR>";

set_error_handler("error_handler");

require_once("DB.php");
--------------------------------------------------------

処理結果
--------------------------------------------------------
error_reporting = 2039
error_reporting = 0
2048 >> Assigning the return value of new by reference is deprecated >>
/usr/local/lib/php/DB.php >> 470
2048 >> Assigning the return value of new by reference is deprecated >>
/usr/local/lib/php/DB.php >> 547
2048 >> var: Deprecated. Please use the public/private/protected modifiers
>> /usr/local/lib/php/DB.php >> 924
2048 >> var: Deprecated. Please use the public/private/protected modifiers
>> /usr/local/lib/php/DB.php >> 930
2048 >> var: Deprecated. Please use the public/private/protected modifiers
>> /usr/local/lib/php/DB.php >> 937
2048 >> var: Deprecated. Please use the public/private/protected modifiers
>> /usr/local/lib/php/DB.php >> 946
2048 >> var: Deprecated. Please use the public/private/protected modifiers
>> /usr/local/lib/php/DB.php >> 952
2048 >> var: Deprecated. Please use the public/private/protected modifiers
>> /usr/local/lib/php/DB.php >> 958
2048 >> var: Deprecated. Please use the public/private/protected modifiers
>> /usr/local/lib/php/DB.php >> 965
2048 >> var: Deprecated. Please use the public/private/protected modifiers
>> /usr/local/lib/php/DB.php >> 975
2048 >> var: Deprecated. Please use the public/private/protected modifiers
>> /usr/local/lib/php/DB.php >> 981
2048 >> var: Deprecated. Please use the public/private/protected modifiers
>> /usr/local/lib/php/DB.php >> 987
2048 >> var: Deprecated. Please use the public/private/protected modifiers
>> /usr/local/lib/php/DB.php >> 1004
2048 >> Assigning the return value of new by reference is deprecated >>
/usr/local/lib/php/DB.php >> 1124
2048 >> var: Deprecated. Please use the public/private/protected modifiers
>> /usr/local/lib/php/PEAR.php >> 112
2048 >> var: Deprecated. Please use the public/private/protected modifiers
>> /usr/local/lib/php/PEAR.php >> 120
2048 >> var: Deprecated. Please use the public/private/protected modifiers
>> /usr/local/lib/php/PEAR.php >> 129
2048 >> var: Deprecated. Please use the public/private/protected modifiers
>> /usr/local/lib/php/PEAR.php >> 138
2048 >> var: Deprecated. Please use the public/private/protected modifiers
>> /usr/local/lib/php/PEAR.php >> 146
2048 >> var: Deprecated. Please use the public/private/protected modifiers
>> /usr/local/lib/php/PEAR.php >> 154
2048 >> Assigning the return value of new by reference is deprecated >>
/usr/local/lib/php/PEAR.php >> 557
2048 >> Assigning the return value of new by reference is deprecated >>
/usr/local/lib/php/PEAR.php >> 560
2048 >> var: Deprecated. Please use the public/private/protected modifiers
>> /usr/local/lib/php/PEAR.php >> 814
2048 >> var: Deprecated. Please use the public/private/protected modifiers
>> /usr/local/lib/php/PEAR.php >> 815
2048 >> var: Deprecated. Please use the public/private/protected modifiers
>> /usr/local/lib/php/PEAR.php >> 816
2048 >> var: Deprecated. Please use the public/private/protected modifiers
>> /usr/local/lib/php/PEAR.php >> 817
2048 >> var: Deprecated. Please use the public/private/protected modifiers
>> /usr/local/lib/php/PEAR.php >> 818
2048 >> var: Deprecated. Please use the public/private/protected modifiers
>> /usr/local/lib/php/PEAR.php >> 819
2048 >> var: Deprecated. Please use the public/private/protected modifiers
>> /usr/local/lib/php/PEAR.php >> 820
--------------------------------------------------------

実際にやりたいことしては、error_reportingを「E_ALL」に設定して、
エラーハンドリングをしたいだけなのですが、
set_error_handlerを行った後に、PEAR DBの「DB.php」をインクルードすると
error_reportingを「0」に設定しても「2048(E_STRICT)」が検出されてしまいます。

マニュアルにはE_STRICTは、E_ALLには含まれないとあるため、「0」に設定しなくと
も
E_ALLに設定すればこれらのエラーは出ないと思うのですが、
error_reportingを何に設定しても、E_STRICTが検出されてしまいます。

また、「set_error_handler」を行わなければエラーは検出されません。

このような現象に遭って、解決できた方
まったく別の方法でも構いませんのでご教授いただけないでしょうか。
以下、当方の環境です。

Redhat Linux 9.0
PHP5.1.2
Apache2.0.55
PEAR DB version 1.7.6

'./configure' '--with-apxs2=/usr/local/apache2/bin/apxs' '--enable-mbstring'
'--with-gettext' '--enable-mbregex' '--enable-sockets'
'--with-pgsql=/usr/local/pgsql' '--without-mysql' '--with-zlib' '--with-gd'
'--with-dom' '--with-dom-xslt' '--with-xsl' '--with-jpeg-dir=/usr/lib'
'--with-png-dir=/usr/lib'


よろしくお願いします。




PHP-users メーリングリストの案内