Req #78401 [NEW]: DateTime::modify signature change
| From: | kylekatarnls at gmail dot com | Date: | Sun, 11 Aug 2019 20:06:30 +0000 |
| Subject: | Req #78401 [NEW]: DateTime::modify signature change | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-222183@lists.php.net to get a copy of this message | ||
From: kylekatarnls at gmail dot com
Operating system: Linux
PHP version: Next Major Version
Package: Compile Failure
Bug Type: Feature/Change Request
Bug description:DateTime::modify signature change
Description:
------------
My last Travis-CI test failed (while same code worked until there) for
PHP 8.0.0-dev with the following message:
Declaration of DateTime::modify(string $modify) must be compatible with
I::modify($modify)
Test script:
---------------
interface I extends DateTimeInterface
{
modify($modify);
}
class A extends DateTime implements I
{
modify($modify) {}
}
Expected result:
----------------
I would expect my interface to be compatible with DateTime since it's
covariant. I accept more types but string is included so it should pass
as there is no reason to forbid this extension.
Then I would be compatible with both PHP 7 and 8 but if I change the
signature to a the string typing, it will fail on PHP 7.
Actual result:
--------------
Declaration of DateTime::modify(string $modify) must be compatible with
I::modify($modify)
--
Edit bug report at https://bugs.php.net/bug.php?id=78401&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=78401&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=78401&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=78401&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=78401&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=78401&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=78401&r=support
Expected behavior: https://bugs.php.net/fix.php?id=78401&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=78401&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=78401&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=78401&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=78401&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=78401&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=78401&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=78401&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=78401&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=78401&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=78401&r=mysqlcfg