#49177 [NEW]: include() causes strict erros when including overloading methods
| From: | ss at zornig dot dk | Date: | Thu, 06 Aug 2009 12:03:09 +0000 |
| Subject: | #49177 [NEW]: include() causes strict erros when including overloading methods | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-140721@lists.php.net to get a copy of this message | ||
From: ss at zornig dot dk
Operating system: FreeBSD
PHP version: 5.2.10
PHP Bug Type: Scripting Engine problem
Bug description: include() causes strict erros when including overloading methods
Description:
------------
When overloading a method, changing a parameter to accept a default value
E_STRICT error is triggered. This however only happens if the object
declaration is loading using include, not if the declaration is in the file
called.
Reproduce code:
---------------
test.php:
<?php
error_reporting(E_ALL | E_STRICT);
abstract class ObjParent {
public function set($param1, $param2){ }
}
require_once('obj.php');
?>
obj.php:
<?php
class ObjChild extends ObjParent {
public function set($param1, $param2=true){ }
}
?>
Expected result:
----------------
This should be without any errors as i would if the test.php looks like
this:
<?php
error_reporting(E_ALL | E_STRICT);
abstract class ObjParent {
public function set($param1, $param2){ }
}
class ObjChild extends ObjParent {
public function set($param1, $param2=true){ }
}
?>
Actual result:
--------------
Strict Standards: Declaration of ObjChild::set() should be compatible with
that of ObjParent::set() in /home/webroot/dumpsite/obj.php on line 8
--
Edit bug report at http://bugs.php.net/?id=49177&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=49177&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=49177&r=trysnapshot53
Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=49177&r=trysnapshot60
Fixed in SVN: http://bugs.php.net/fix.php?id=49177&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=49177&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=49177&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=49177&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=49177&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=49177&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=49177&r=support
Expected behavior: http://bugs.php.net/fix.php?id=49177&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=49177&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=49177&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=49177&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=49177&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=49177&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=49177&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=49177&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=49177&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=49177&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=49177&r=mysqlcfg