php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74404 Wrong reflection on DateTimeZone::getTransitions
Submitted: 2017-04-10 11:41 UTC Modified: -
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: fabien dot villepinte at gmail dot com Assigned:
Status: Closed Package: Date/time related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
 [2017-04-10 11:41 UTC] fabien dot villepinte at gmail dot com
Description:
------------
The parameters of DateTimeZone::getTransitions are optional(see: http://php.net/manual/en/datetimezone.gettransitions.php ), but they are described as required by reflection.

Test script:
---------------
<?php

$rm = new ReflectionMethod(DateTimeZone::class, "getTransitions");
printf("%d\n%d\n", $rm->getNumberOfParameters(), $rm->getNumberOfRequiredParameters());
foreach ($rm->getParameters() as $param) {
    printf("Parameter #%d %s OPTIONAL\n", $param->getPosition(), $param->isOptional() ? "IS" : "IS NOT");
}

Expected result:
----------------
2
0
Parameter #0 IS OPTIONAL
Parameter #1 IS OPTIONAL

Actual result:
--------------
2
2
Parameter #0 IS NOT OPTIONAL
Parameter #1 IS NOT OPTIONAL

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-04-10 11:50 UTC] krakjoe@php.net
Automatic comment on behalf of krakjoe
Revision: http://git.php.net/?p=php-src.git;a=commit;h=d9e2f803750033bdd6dcf756ef1ca85dc53309dd
Log: Fixed bug #74404 (wrong reflection on DateTimeZone::getTransitions)
 [2017-04-10 11:50 UTC] krakjoe@php.net
-Status: Open +Status: Closed
 [2017-04-10 11:51 UTC] krakjoe@php.net
Automatic comment on behalf of krakjoe
Revision: http://git.php.net/?p=php-src.git;a=commit;h=d9e2f803750033bdd6dcf756ef1ca85dc53309dd
Log: Fixed bug #74404 (wrong reflection on DateTimeZone::getTransitions)
 [2017-04-10 11:52 UTC] krakjoe@php.net
Automatic comment on behalf of krakjoe
Revision: http://git.php.net/?p=php-src.git;a=commit;h=d9e2f803750033bdd6dcf756ef1ca85dc53309dd
Log: Fixed bug #74404 (wrong reflection on DateTimeZone::getTransitions)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 02:01:28 2024 UTC