#30184 [Bgs]: run-tests error_reporting / ~E_STRICT ignored in phpt files
ID: 30184
User updated by: danielc at analysisandsolutions dot com
Reported By: danielc at analysisandsolutions dot com
Status: Bogus
Bug Type: Unknown/Other Function
Operating System: Win 2000
PHP Version: 5CVS-2004-09-21 (dev)
New Comment:
Andi:
Thanks for the --INI-- tip.
Regarding your first email which said "make sure that E_STRICT is
turned off in the INI," php.ini already had reporting set to E_ALL but
it's being ignored.
The reason I posted it as a bug was this issue seems to have only arose
in the recent past. This issue hadn't come up while I was developing DB
and HTML_Form even though I've been running snapshots of PHP 5 for a
long while.
Thanks again.
Previous Comments:
------------------------------------------------------------------------
[2004-09-22 23:43:23] derick@php.net
And you should use an --INI-- section in your test file for this
anyway.
------------------------------------------------------------------------
[2004-09-22 23:04:31] andi@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
Certain E_STRICT notices (such as var being deprecated) are emited at
compile-time therefore changing the error_reporting (which only happens
at run-time) will not affect it. You will need to make sure that
E_STRICT is turned off in the INI. One work around for the tests might
be to put the source in an include file and change error_reporting
before we include it. This issue was discussed on internals@ a few
months back and this behavior was agreed on because some of these
E_STRICT issues have to be detected at compile-time.
------------------------------------------------------------------------
[2004-09-21 23:34:25] danielc at analysisandsolutions dot com
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;
}
------------------------------------------------------------------------
[2004-09-21 19:39:19] 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
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=30184&edit=1
Thread (5 messages)