Bug #63133 [Opn->Fbk]: Runtime Notice & Declaration of private methods
| From: | laruence@php.net | Date: | Sat, 22 Sep 2012 03:26:01 +0000 |
| Subject: | Bug #63133 [Opn->Fbk]: Runtime Notice & Declaration of private methods | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-173624@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=63133&edit=1
ID: 63133
Updated by: laruence@php.net
Reported by: goetas at lignano dot it
Summary: Runtime Notice & Declaration of private methods
-Status: Open
+Status: Feedback
Type: Bug
Package: *General Issues
Operating System: ubuntu/slackware
PHP Version: 5.3.17
Block user comment: N
Private report: N
New Comment:
the two example both throw strict warning here. could you please check it again?
make sure you set error_reporting to show E_STRICT.
the fix for #62956 is only for 5.4 branch. 5.3 is a very stable version, we don't
want to make such change to it.
thanks
Previous Comments:
------------------------------------------------------------------------
[2012-09-21 15:45:12] goetas at lignano dot it
Description:
------------
There is some "erros" with overwritten private methods in different classes.
The bug is linked to #62956, but the bug seems to be solved only for classes defined inside the same
file.
Test script:
---------------
Example 1
test.php
----
class ClassA {
public function fun(){
$this->myMethod(5);
}
private function myMethod($param){
}
}
class ClassB extends ClassA {
public function fun(){
$this->myMethod();
}
private function myMethod(){
}
}
---
Example 2
----
test.php
----
class ClassA {
public function fun(){
$this->myMethod(5);
}
private function myMethod($param){
}
}
include 'test2.php'
---
test2.php
----
class ClassB extends ClassA {
public function fun(){
$this->myMethod();
}
private function myMethod(){
}
}
---
Expected result:
----------------
The two examples should work both
Actual result:
--------------
The second example rises this error:
Strict Standards: Declaration of ClassB::myMethod() should be compatible with that of
ClassA::myMethod() in /mnt/md1/data/www/test2.php on line 0
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=63133&edit=1