com php-src: Fix #70266 (DateInterval::__construct. interval_spec is not supposed to be optional) : ext/date/php_date.c ext/date/tests/bug7026 6.phpt
| From: | Christoph Michael Becker | Date: | Fri, 14 Aug 2015 12:19:12 +0000 |
| Subject: | com php-src: Fix #70266 (DateInterval::__construct. interval_spec is not supposed to be optional) : ext/date/php_date.c ext/date/tests/bug7026 6.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-88530@lists.php.net to get a copy of this message | ||
Commit: e66bf11638409b9582d5b9159b97e8b108c29796
Author: Christoph M. Becker <cmb@php.net> Fri, 14 Aug 2015 14:19:12 +0200
Parents: cd18ba117cd3d32b760aa7e16a78947aa91e254a
Branches: PHP-5.6 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=e66bf11638409b9582d5b9159b97e8b108c29796
Log:
Fix #70266 (DateInterval::__construct.interval_spec is not supposed to be optional)
The required_num_args argument of ZEND_BEGIN_ARG_INFO_EX() has to be 1.
Bugs:
https://bugs.php.net/70266
Changed paths:
M ext/date/php_date.c
A ext/date/tests/bug70266.phpt
Diff:
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index 2e3b3fd..4ed439c 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -383,7 +383,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_date_period_construct, 0, 0, 3)
ZEND_ARG_INFO(0, end)
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_INFO_EX(arginfo_date_interval_construct, 0, 0, 0)
+ZEND_BEGIN_ARG_INFO_EX(arginfo_date_interval_construct, 0, 0, 1)
ZEND_ARG_INFO(0, interval_spec)
ZEND_END_ARG_INFO()
/* }}} */
diff --git a/ext/date/tests/bug70266.phpt b/ext/date/tests/bug70266.phpt
new file mode 100644
index 0000000..5eeebab
--- /dev/null
+++ b/ext/date/tests/bug70266.phpt
@@ -0,0 +1,8 @@
+--TEST--
+Bug #70266 (DateInterval::__construct.interval_spec is not supposed to be optional)
+--FILE--
+<?php
+var_dump((new ReflectionParameter(['DateInterval', '__construct'],
0))->isOptional());
+?>
+--EXPECT--
+bool(false)