ID: 50884 Comment by: themastersleader at hotmail dot com Reported By: themastersleader at hotmail dot com Status: Open Bug Type: Class/Object related Operating System: -- PHP Version: 5.3.1 New Comment:
Because of wordwrap in the code, when you copy paste it u get syntax errors....... i hope u notice (webui http://bugs.php.net/50884) Previous Comments: ------------------------------------------------------------------------ [2010-01-29 23:48:52] themastersleader at hotmail dot com 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 this bug report at http://bugs.php.net/?id=50884&edit=1