From: themastersleader at hotmail dot com Operating system: -- PHP version: 5.3.1 PHP Bug Type: Class/Object related Bug description: Internal interface implementation bug (on C level)
Description: ------------ Hello i sumbitted 2 times this bug. but before u close this... Please read. (and yes the reproduce code is longer then the 20 lines sorry for that) The code works fine in php 5.2.X but fails in php 5.3.X (tested on xampp win) In the source code u will see. Maybe it isn't a important bug but in the future of OOP it will be a big issue, and please trust me i know how to program.. (maybe it's to hard to find the bug in the bugtracking but also please tell me or something??) PLEASE PLEASE STUDY THE CODE..... Thanks for your understanding and greetz Sander Visser Reproduce code: --------------- <?php /** * I posted this bug serveral times, (and no i'm not a noob, please assume that for me????, and yes read more :) ) * 40933 48984 are the bug id's from previeus reports * The bug shows itself when some class implements (a empty) or some inrelevant function (in the interface) * The problem is when we implement an interface the private methods of all classes that implements it * are not fully private anymore. please observe the code below * I know it's longer than the lines i can give, but please read it.............. * * If this isn't a bug please give me a (global) description why it isn't so i understand. * I think if it isn't defined as a bug it's a diffuculty in c languages to solve it, so u guys choose to function it like it does from php 5.3.0 but say so * * sorry for my bad english i'm dutch (and it's later but forget that haha) */ ///////////// // THIS PART FUNCTIONS PERFECTLY ///////////// class Foo { //This is a private function used for internal usages //This has nothing to do with classes that extends this class private function thisIsAFunction() { echo('Foo::thisISAFunction()'); } } class Bar extends Foo { //NOTICE: We are not overriding the base function public function thisIsAFunction($var) { echo('Bar::thisIsAFunction() and we have var ' . $var); } } //This works Perfect $good = new Bar(); $good->thisIsAFunction('hello'); ///////// //THIS DOESN'T //Please notice the interface with an inrelevant function to the bug ///////// interface IBugable { public function dummyMethod(); } class FooBug implements IBugable { public function dummyMethod() { } //This is a private function used for internal usages //This has nothing to do with classes that extends this class private function thisIsAFunction() { echo('Foo::thisISAFunction()'); } } class BarBug extends FooBug { //NOTICE: We are not overriding the base function public function thisIsAFunction($var) { echo('Bar::thisIsAFunction() and we have var ' . $var); } } //This won't work $bad = new BarBug(); $bad->thisIsAFunction('hello'); // We assum we get as result (echo) Bar::thisIsAFunction() bur it doesn't happen ?> Expected result: ---------------- Please read the information for this Actual result: -------------- Please read the information for this -- Edit bug report at http://bugs.php.net/?id=50884&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=50884&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=50884&r=trysnapshot53 Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=50884&r=trysnapshot60 Fixed in SVN: http://bugs.php.net/fix.php?id=50884&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=50884&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=50884&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=50884&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=50884&r=needscript Try newer version: http://bugs.php.net/fix.php?id=50884&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=50884&r=support Expected behavior: http://bugs.php.net/fix.php?id=50884&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=50884&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=50884&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=50884&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=50884&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=50884&r=dst IIS Stability: http://bugs.php.net/fix.php?id=50884&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=50884&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=50884&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=50884&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=50884&r=mysqlcfg