Edit report at https://bugs.php.net/bug.php?id=63336&edit=1
ID: 63336 Updated by: larue...@php.net Reported by: tomoya-yokota at cybozu dot co dot jp Summary: invalid E_NOTICE error occur Status: Open Type: Bug Package: Compile Warning Operating System: ubuntu12.04 PHP Version: 5.4.8 Block user comment: N Private report: N New Comment: you said "set error_reporting with error_report( E_STRICT & ~ E_STRICT )." but your test script sasy: "error_reporting( E_ALL & ~ E_STRICT );" ? Previous Comments: ------------------------------------------------------------------------ [2012-10-23 02:29:55] tomoya-yokota at cybozu dot co dot jp Description: ------------ 1. set error_reporting with error_report( E_STRICT & ~ E_STRICT ). 2. call set_error_handler( callable $error_handler, E_STRICT & ~ E_STRICT ). 3. execute Bellow script(test.php) 4. E_NOTICE Error occur ( Error Message is Use of undefined constant XXX - assumed 'XXX' ) # when the script of PHP is splitted by Class, This issue does not occur. Test script: --------------- ------ test.php ------ <?php error_reporting( E_ALL & ~ E_STRICT ); function myErrorHandler($errno, $errstr, $errfile, $errline) { if( $errno === E_NOTICE ) { echo "{$errstr}\n"; } if( $errno === E_STRICT ) { echo "{$errstr}\n"; } } set_error_handler('myErrorHandler', E_ALL & ~ E_STRICT ); require_once("sample.php"); ------ sample.php ------ <?php define("TEST", "123"); class Hoge2 { public function moge($var=TEST, $moge=null) { return true; } } class HogeChild extends Hoge2 { public function moge($var=TEST) { return true; } } Expected result: ---------------- 1. E_NOTICE would not be reported 2. E_STRICT wouble be reported. Actual result: -------------- 1. E_NOTICE was reported. ---- error message ---- Use of undefined constant TEST - assumed 'TEST' ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=63336&edit=1