|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-03-27 15:51 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Dec 05 18:00:01 2025 UTC |
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"