php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50884 Internal interface implementation bug (on C level)
Submitted: 2010-01-29 23:48 UTC Modified: 2010-04-25 20:17 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: themastersleader at hotmail dot com Assigned:
Status: Not a bug Package: Class/Object related
PHP Version: 5.3.1 OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: themastersleader at hotmail dot com
New email:
PHP Version: OS:

 

 [2010-01-29 23:48 UTC] 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-01-29 23:58 UTC] 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-30 00:21 UTC] jani@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-02-06 01:00 UTC] 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-04-25 20:17 UTC] felipe@php.net
-Status: No Feedback +Status: Bogus
 [2010-04-25 20:17 UTC] felipe@php.net
I got 'Bar::thisIsAFunction() and we have var hello', looks as the expected behavior.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 04 13:01:30 2024 UTC