Mombu the Php Forum

Go Back   Mombu the Php Forum > Php > #40930 : Different error handling on different callings with E_STRICT
User Name
Password
REGISTER NOW! Mark Forums Read




Reply Bookmark and Share
1 6th October 17:11
php-bugs@lists.php.net
External User
 
Posts: 1
Default #40930 : Different error handling on different callings with E_STRICT



From: timo@php.net
Operating system: Linux/WinXP
PHP version: 5.2.1
PHP Bug Type: Scripting Engine problem
Bug description: Different error handling on different callings with E_STRICT

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 bug report at http://bugs.php.net/?id=40930&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=40930&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=40930&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=40930&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=40930&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=40930&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=40930&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=40930&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=40930&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=40930&r=support
Expected behavior: http://bugs.php.net/fix.php?id=40930&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=40930&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=40930&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=40930&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=40930&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=40930&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=40930&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=40930&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=40930&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=40930&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=40930&r=mysqlcfg
  Reply With Quote


 


2 6th October 17:12
tony2001
External User
 
Posts: 1
Default #40930 : Different error handling on different callings with E_STRICT



ID: 40930
Updated by: tony2001@php.net
Reported By: timo@php.net
-Status: Open
+Status: Bogus
Bug Type: Scripting Engine problem
Operating System: Linux/WinXP
PHP Version: 5.2.1
New Comment:


because error_reporting() is called when compilation is done, so the
error level did no include E_STRICT.

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] timo@php.net

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
  Reply With Quote


 


Reply


Thread Tools
Display Modes


Some other forums that might be of your interest : Php 5 forum, Apache forum, Iis forum, Functions forum, Classes forum, Librarys forum, Bugs forum, Postgres forum, Mysql forum, Paradox forum, Ms sql forum, Configurations forum, Php.ini forum, Problems forum, Scripting forum, Css forum, General forums, Off-topic talk, Links, Extra forums, Php


Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666