Edit report at http://bugs.php.net/bug.php?id=50884&edit=1

 ID:               50884
 Updated by:       fel...@php.net
 Reported by:      themastersleader at hotmail dot com
 Summary:          Internal interface implementation bug (on C level)
-Status:           No Feedback
+Status:           Bogus
 Type:             Bug
 Package:          Class/Object related
 Operating System: *
 PHP Version:      5.3.1

 New Comment:

I got 'Bar::thisIsAFunction() and we have var hello', looks as the
expected behavior.


Previous Comments:
------------------------------------------------------------------------
[2010-02-06 01:00:01] php-bugs at lists dot php dot net

No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".

------------------------------------------------------------------------
[2010-01-30 00:21:16] j...@php.net

Please try using this snapshot:

  http://snaps.php.net/php5.3-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/

And it would help if you did come up with a short script. Also, you
failed to explain what your problem is so that people could understand
it. Usually short code explains it better than bad english. "Does not
work" is not a description of bug. By leaving extremely long gibberish
comments out of the script would make it a lot shorter btw. And this is
still no bug in my opinion. Did you even try reading the manual..?

------------------------------------------------------------------------
[2010-01-29 23:58:02] themastersleader at hotmail dot com

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)

------------------------------------------------------------------------
[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/bug.php?id=50884&edit=1

Reply via email to