Skip to content

Commit 8e19705

Browse files
committed
Fixed bug #55407 (Impossible to prototype DateTime::createFromFormat)
1 parent cca3c8a commit 8e19705

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ PHP NEWS
44

55
- Date:
66
. Fixed bug #45081 (strtotime incorrectly interprets SGT time zone). (Derick)
7+
. Fixed bug #55407 (Impossible to prototype DateTime::createFromFormat).
8+
(Derick, Felipe)
79

810
- Dba:
911
. Fixed bug #68711 (useless comparisons). (bugreports at internot dot info)

ext/date/php_date.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ ZEND_END_ARG_INFO()
163163
ZEND_BEGIN_ARG_INFO_EX(arginfo_date_create_from_format, 0, 0, 2)
164164
ZEND_ARG_INFO(0, format)
165165
ZEND_ARG_INFO(0, time)
166-
ZEND_ARG_INFO(0, object)
166+
ZEND_ARG_OBJ_INFO(0, object, DateTimeZone, 1)
167167
ZEND_END_ARG_INFO()
168168

169169
ZEND_BEGIN_ARG_INFO_EX(arginfo_date_parse, 0, 0, 1)

ext/date/tests/bug55407.phpt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
--TEST--
2+
Bug #55407 (Impossible to prototype DateTime::createFromFormat)
3+
--INI--
4+
error_reporting=-1
5+
--FILE--
6+
<?php namespace melt\core;
7+
8+
class DateTime extends \DateTime {
9+
public static function createFromFormat($format, $time, DateTimeZone $timezone = null) {
10+
return new DateTime(parent::createFromFormat($format, $time, $timezone));
11+
}
12+
}
13+
14+
echo "DONE\n";
15+
?>
16+
--EXPECTF--
17+
DONE

0 commit comments

Comments
 (0)