php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70266 DateInterval::__construct.interval_spec is not supposed to be optional
Submitted: 2015-08-14 07:47 UTC Modified: 2015-08-14 12:11 UTC
From: ocramius at gmail dot com Assigned: cmb (profile)
Status: Closed Package: Date/time related
PHP Version: 7.0.0beta3 OS:
Private report: No CVE-ID: None
 [2015-08-14 07:47 UTC] 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-08-14 12:11 UTC] cmb@php.net
-Status: Open +Status: Analyzed -Assigned To: +Assigned To: cmb
 [2015-08-14 12:11 UTC] cmb@php.net
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>.
 [2015-08-14 12:34 UTC] cmb@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=php-src.git;a=commit;h=e66bf11638409b9582d5b9159b97e8b108c29796
Log: Fix #70266 (DateInterval::__construct.interval_spec is not supposed to be optional)
 [2015-08-14 12:34 UTC] cmb@php.net
-Status: Analyzed +Status: Closed
 [2015-08-18 16:24 UTC] ab@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=php-src.git;a=commit;h=e66bf11638409b9582d5b9159b97e8b108c29796
Log: Fix #70266 (DateInterval::__construct.interval_spec is not supposed to be optional)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 06:01:30 2024 UTC