ID: 40930
Updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
-Status: Open
+Status: Bogus
Bug Type: Scripting Engine problem
Operating System: Linux/WinXP
PHP Version: 5.2.1
New Comment:
>- calling the first example file (file1.php) directly will run fine.
because error_reporting() is called when compilation is done, so the
error level did no include E_STRICT.
>- calling the second example file (file2.php), which will include
>the first file, results in the following notice:
because error_reporting is set before the compilation is started, so
the error level DID include E_STRICT.
This is expected behaviour.
Previous Comments:
------------------------------------------------------------------------
[2007-03-27 15:42:36] [EMAIL PROTECTED]
Description:
------------
Assume there a two classes. The first class is an abstract class which
only defines a default protected method having no parameters. The second
class (could be in same file) will extend the first class and overrides
the method from the first class using a single parameter. This will run
without any notices if i use error_reporting( E_ALL ^ E_STRICT ).
but if i will include the file within an other file, it will result in
a "Strict Standards" notice.
It does not depend on the way i call it - apache or cli.
Reproduce code:
---------------
----- FILE 1 (file1.php)-----
<?php
error_reporting( E_ALL ^ E_STRICT );
abstract class AbstractTest {
protected function _update() {}
}
abstract class Test extends AbstractTest {
protected function _update( $var ) {}
}
?>
------ FILE 2 (file2.php)-----
<?php
error_reporting( E_ALL ^ E_STRICT );
include 'file1.php';
?>
Expected result:
----------------
both ways should run in same way.
Actual result:
--------------
- calling the first example file (file1.php) directly will run fine.
- calling the second example file (file2.php), which will include the
first file, results in the following notice:
"Strict Standards: Declaration of Test::_update() should be compatible
with that of AbstractTest::_update() in \htdocs\file1.php on line 8"
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=40930&edit=1