Skip to content

Commit f2e7cdb

Browse files
keluniknikic
authored andcommitted
Fix bug #55407
This reverts commit b148c50 and reintroduces the fix for bug #55407. With https://wiki.php.net/rfc/parameter-no-type-variance being implemented now, it's no longer a BC break.
1 parent 8eb7efc commit f2e7cdb

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

NEWS

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,15 @@ PHP NEWS
6464
. Fix integer overflows (Joshua Rogers)
6565

6666
- Date:
67+
. Fixed bug #55407 (Impossible to prototype DateTime::createFromFormat).
68+
(kelunik)
6769
. Fixed bug #69587 (DateInterval properties and isset). (jhdxr)
6870
. Fixed bug #74404 (Wrong reflection on DateTimeZone::getTransitions).
6971
(krakjoe)
7072
. Fixed bug #74080 (add constant for RFC7231 format datetime). (duncan3dc)
7173
. Fixed bug #74639 (implement clone for DatePeriod and DateInterval).
7274
(andrewnester)
7375

74-
7576
- Dba:
7677
. Fixed bug #72885 (flatfile: dba_fetch() fails to read replaced entry).
7778
(Anatol)

ext/date/php_date.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ ZEND_END_ARG_INFO()
167167
ZEND_BEGIN_ARG_INFO_EX(arginfo_date_create_from_format, 0, 0, 2)
168168
ZEND_ARG_INFO(0, format)
169169
ZEND_ARG_INFO(0, time)
170-
ZEND_ARG_INFO(0, object)
170+
ZEND_ARG_OBJ_INFO(0, object, DateTimeZone, 1)
171171
ZEND_END_ARG_INFO()
172172

173173
ZEND_BEGIN_ARG_INFO_EX(arginfo_date_parse, 0, 0, 1)

ext/date/tests/bug55407.phpt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@
22
Bug #55407 (Impossible to prototype DateTime::createFromFormat)
33
--INI--
44
error_reporting=-1
5-
--XFAIL--
6-
Bug #55407
75
--FILE--
86
<?php namespace melt\core;
97

108
class DateTime extends \DateTime {
11-
public static function createFromFormat($format, $time, DateTimeZone $timezone = null) {
9+
public static function createFromFormat($format, $time, \DateTimeZone $timezone = null) {
1210
return new DateTime(parent::createFromFormat($format, $time, $timezone));
1311
}
1412
}

0 commit comments

Comments
 (0)