|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2004-09-21 19:39 UTC] danielc at analysisandsolutions dot com
Description:
------------
Using:
* PHP 5.0.2RC1 (cli) (built: Sep 21 2004 10:29:26)
* run-tests.php version 1.195.2.1 or HEAD
When error_reporting is set to E_ALL in a .phpt file, E_STRICT warnings still come up for code in the .phpt file. The notice isn't generated for code in included files.
Reproduce code:
---------------
NOTE: two files...
=============== s.phpt =================
--TEST--
error_reporting ignored for code in phpt
--SKIPIF--
--FILE--
<?php
/*
* error_reporting(E_ALL) is ignored for the code
* in this file but not the included file.
*/
error_reporting(E_ALL);
include './s.inc';
class phpt {
var $phpt_var;
}
?>
--EXPECT--
=============== s.inc =================
<?php
class inc {
var $inc_var;
}
Expected result:
----------------
Test to pass.
Actual result:
--------------
If error_reporting(E_ALL)
-------------------------
Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in s.php on line 12
If error_reporting(E_ALL) commented out
---------------------------------------
Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in s.php on line 12
Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in s.inc on line 4
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 21 03:00:01 2025 UTC |
Something else to take into consideration is run-tests.php is overriding the error_reporting settings from php.ini. This is causing tests to fail even though the same tests worked fine under development versions of PHP 5. Here's a new set of test scripts... =========== s.phpt ================ --TEST-- error_reporting ignored for code in phpt --SKIPIF-- --FILE-- <?php echo 'Default error_reporting in s.phpt: ' . error_reporting() . "\n"; /* * RESULT: * Strict Standards: var: Deprecated. Please use the * public/private/protected modifiers in s.php on line 28 * Default error_reporting in s.phpt: 4095 * The error_reporting in s.inc: 2047 * Subsequent error_reporting in s.phpt: 2047 * * RESULT if error_reporting(E_ALL) is commented out: * Strict Standards: var: Deprecated. Please use the * public/private/protected modifiers in s.php on line 28 * Default error_reporting in s.phpt: 4095 * Strict Standards: var: Deprecated. Please use the * public/private/protected modifiers in s.inc on line 6 * The error_reporting in s.inc: 4095 * Subsequent error_reporting in s.phpt: 4095 */ error_reporting(E_ALL); include './s.inc'; class phpt { var $phpt_var; } echo 'Subsequent error_reporting in s.phpt: ' . error_reporting() . "\n"; ?> --EXPECT-- Default error_reporting in s.phpt: 2047 The error_reporting in s.inc: 2047 Subsequent error_reporting in s.phpt: 2047 =========== s.inc ================ <?php echo 'The error_reporting in s.inc: ' . error_reporting() . "\n"; class inc { var $inc_var; }