Bug #70266 [Opn->Ana]: DateInterval::__construct.interval_spec is not supposed to be optional
| From: | cmb@php.net | Date: | Fri, 14 Aug 2015 12:11:37 +0000 |
| Subject: | Bug #70266 [Opn->Ana]: DateInterval::__construct.interval_spec is not supposed to be optional | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-195205@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=70266&edit=1
ID: 70266
Updated by: cmb@php.net
Reported by: ocramius at gmail dot com
Summary: DateInterval::__construct.interval_spec is not
supposed to be optional
-Status: Open
+Status: Analyzed
Type: Bug
Package: Date/time related
PHP Version: 7.0.0beta3
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Indeed, the required_num_args argument of ZEND_BEGIN_ARG_INFO_EX()
is wrong:
<https://github.com/php/php-src/blob/php-5.6.12/ext/date/php_date.c#L386>.
Previous Comments:
------------------------------------------------------------------------
[2015-08-14 07:47:50] ocramius at gmail dot com
Description:
------------
As per http://3v4l.org/HBIB5,
DateInterval::__construct.interval_spec is defined as optional in PHP7
Test script:
---------------
if ((new ReflectionParameter(['DateInterval', '__construct'],
0))->isOptional()) {
echo 'optional';
} else {
echo 'non optional';
}
Expected result:
----------------
non optional
Actual result:
--------------
optional
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=70266&edit=1