Doc #52716 [NEW]: Interface difference between 5.2.6 and 5.3.2
| From: | analytik at uglycode dot com | Date: | Fri, 27 Aug 2010 07:45:50 +0000 |
| Subject: | Doc #52716 [NEW]: Interface difference between 5.2.6 and 5.3.2 | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-4939@lists.php.net to get a copy of this message | ||
From:
Operating system: Kubuntu and Debian
PHP version: Irrelevant
Package: Documentation problem
Bug Type: Documentation Problem
Bug description:Interface difference between 5.2.6 and 5.3.2
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 bug report at http://bugs.php.net/bug.php?id=52716&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=52716&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=52716&r=trysnapshot53
Try a snapshot (trunk): http://bugs.php.net/fix.php?id=52716&r=trysnapshottrunk
Fixed in SVN: http://bugs.php.net/fix.php?id=52716&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=52716&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=52716&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=52716&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=52716&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=52716&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=52716&r=support
Expected behavior: http://bugs.php.net/fix.php?id=52716&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=52716&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=52716&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=52716&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=52716&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=52716&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=52716&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=52716&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=52716&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=52716&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=52716&r=mysqlcfg