php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54722 Extend interface (adding a parameters)
Submitted: 2011-05-12 17:58 UTC Modified: 2011-05-21 02:14 UTC
Votes:4
Avg. Score:4.0 ± 0.7
Reproduced:3 of 3 (100.0%)
Same Version:2 (66.7%)
Same OS:2 (66.7%)
From: virusxd at o2 dot pl Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.3.6 OS: Windows 7 / IIS 7.5
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: virusxd at o2 dot pl
New email:
PHP Version: OS:

 

 [2011-05-12 17:58 UTC] virusxd at o2 dot pl
Description:
------------
I extend interface because I wish add more parameters.
But this code not works.

::Sory, This is my first time.

Test script:
---------------
interface iData{
	public function Get($name);
}

interface iCookie extends iData{
	public function Get($name, $details = false);
}


class Cookie implements iCookie{
	public function Get($name, $details = false){
		echo('TEST!');
	}
}

Expected result:
----------------
TEST!

Actual result:
--------------
Fatal error: Can't inherit abstract function iData::Get() (previously declared abstract in iCookie) in C:\iCookie.php on line 4

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-05-21 02:14 UTC] felipe@php.net
-Status: Open +Status: Bogus
 [2011-05-21 02:14 UTC] felipe@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Jul 26 06:00:03 2025 UTC