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
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: ocramius at gmail dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

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: Thu Nov 21 10:01:29 2024 UTC