com php-src: Fixed bug #55407 (Impossible to prototype DateTime::createFromFormat): NEWS ext/date/php_date.c ext /date/tests/bug55407.phpt
| From: | Derick Rethans | Date: | Tue, 20 Jan 2015 21:44:19 +0000 |
| Subject: | com php-src: Fixed bug #55407 (Impossible to prototype DateTime::createFromFormat): NEWS ext/date/php_date.c ext /date/tests/bug55407.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-84235@lists.php.net to get a copy of this message | ||
Commit: 8e19705a93d785cd1ff8ba3a69699b00169fea47
Author: Derick Rethans <github@derickrethans.nl> Tue, 20 Jan 2015 21:44:19 +0000
Parents: cca3c8a9852db83d2acd16810fe2b426aa047752
Branches: PHP-5.5 PHP-5.6 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=8e19705a93d785cd1ff8ba3a69699b00169fea47
Log:
Fixed bug #55407 (Impossible to prototype DateTime::createFromFormat)
Bugs:
https://bugs.php.net/55407
Changed paths:
M NEWS
M ext/date/php_date.c
A ext/date/tests/bug55407.phpt
Diff:
diff --git a/NEWS b/NEWS
index ac4d5aa..eeb71e9 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,8 @@ PHP NEWS
- Date:
. Fixed bug #45081 (strtotime incorrectly interprets SGT time zone). (Derick)
+ . Fixed bug #55407 (Impossible to prototype DateTime::createFromFormat).
+ (Derick, Felipe)
- Dba:
. Fixed bug #68711 (useless comparisons). (bugreports at internot dot info)
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index 58e23c0..fb3eaca 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date..c
@@ -163,7 +163,7 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_date_create_from_format, 0, 0, 2)
ZEND_ARG_INFO(0, format)
ZEND_ARG_INFO(0, time)
- ZEND_ARG_INFO(0, object)
+ ZEND_ARG_OBJ_INFO(0, object, DateTimeZone, 1)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_date_parse, 0, 0, 1)
diff --git a/ext/date/tests/bug55407.phpt b/ext/date/tests/bug55407.phpt
new file mode 100644
index 0000000..00c3356
--- /dev/null
+++ b/ext/date/tests/bug55407.phpt
@@ -0,0 +1,17 @@
+--TEST--
+Bug #55407 (Impossible to prototype DateTime::createFromFormat)
+--INI--
+error_reporting=-1
+--FILE--
+<?php namespace melt\core;
+
+class DateTime extends \DateTime {
+ public static function createFromFormat($format, $time, DateTimeZone $timezone = null) {
+ return new DateTime(parent::createFromFormat($format, $time, $timezone));
+ }
+}
+
+echo "DONE\n";
+?>
+--EXPECTF--
+DONE