Doc #52716 [Csd]: Interface difference between 5.2.6 and 5.3.2
| From: | kalle@php.net | Date: | Fri, 22 Oct 2010 02:16:19 +0000 |
| Subject: | Doc #52716 [Csd]: Interface difference between 5.2.6 and 5.3.2 | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-5316@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=52716&edit=1
ID: 52716
Updated by: kalle@php.net
Reported by: analytik at uglycode dot com
Summary: Interface difference between 5.2.6 and 5.3.2
Status: Closed
Type: Documentation Problem
Package: Documentation problem
Operating System: Kubuntu and Debian
PHP Version: Irrelevant
Assigned To: kalle
Block user comment: N
New Comment:
jpauli:
I did some testing across all versions of the 5.1, 5.2 and 5.3 branches
and it was changed in 5.3+. My testing indicated that all 5.1 and 5.2
versions worked the same here.
As for the wording, I could not find a better way to make it more clear,
feel free to improve it if you can come up with a better meaning.
Previous Comments:
------------------------------------------------------------------------
[2010-10-20 21:24:51] jpauli@php.net
Kalle, could you clarify your patch ?
It seems to say the opposite, or at least I misunderstood it.
Even for my language (french), I admit it's hard to translate for the
end-user to fully understand the new behavior.
------------------------------------------------------------------------
[2010-10-20 08:36:31] kalle@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation
better.
------------------------------------------------------------------------
[2010-10-20 08:36:23] kalle@php.net
Automatic comment from SVN on behalf of kalle
Revision: http://svn.php.net/viewvc/?view=revision&revision=304533
Log: Fixed bug #52716 (Interface difference between 5.2.6 and 5.3.2)
------------------------------------------------------------------------
[2010-08-27 09:45:50] analytik at uglycode dot com
Description:
------------
PHP versions:
5.3.2-1ubuntu4.2
5.2.6-1+lenny9
There isn't mentioned a difference between 5.2 and 5.3 in interface
behavior.
In 5.2, if defined class/method has default values, interface MUST have
default values.
In 5.3, interface DOES NOT NEED TO have default values.
Test script:
---------------
<?php
error_reporting(E_ALL | E_STRICT);
interface DefaultsInterface {
public function foobar($a = false, $b = false, $c = false);
}
interface ParamsInterface {
public function fubar($a, $b, $c);
}
class WorksFine implements DefaultsInterface {
public function foobar($a = true, $b = false, $c = true) {}
}
class DiesOnFiveTwo implements ParamsInterface {
public function fubar($a = true, $b = false, $c = true) {}
}
$a = new WorksFine();
$b = new DiesOnFiveTwo();
var_dump($a, $b);
Expected result:
----------------
I expect the documentation to mention the difference.
Actual result:
--------------
5.3 result:
object(WorksFine)[1]
object(DiesOnFiveTwo)[2]
5.2 result:
Fatal error: Declaration of DiesOnFiveTwo::fubar() must be compatible
with that of ParamsInterface::fubar() in
/var/www/dev.piklio.com/httpdocs/faces.php on line 17
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=52716&edit=1