|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2017-04-15 11:02 UTC] fabien dot villepinte at gmail dot com
-Type: Bug
+Type: Documentation Problem
-PHP Version: Irrelevant
+PHP Version: 7.1
[2017-04-15 11:02 UTC] fabien dot villepinte at gmail dot com
[2017-08-12 00:56 UTC] ajf@php.net
[2017-08-12 00:58 UTC] ajf@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: ajf
[2017-08-12 00:58 UTC] ajf@php.net
[2020-02-07 06:06 UTC] phpdocbot@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 07 15:00:01 2026 UTC |
Description: ------------ According the documentation the methods DateTime::setTime and DateTimeImmutable::setTime have 3 parameters, but by using reflection we can see there is a 4th parameter ("microseconds"). http://php.net/manual/en/datetime.settime.php http://php.net/manual/en/datetimeimmutable.settime.php Test script: --------------- <?php $rm = new ReflectionMethod(DateTime::class, "setTime"); printf("%d\n%d\n", $rm->getNumberOfParameters(), $rm->getNumberOfRequiredParameters()); foreach ($rm->getParameters() as $param) { printf("Parameter #%d (%s) %s OPTIONAL\n", $param->getPosition(), $param->getName(), $param->isOptional() ? "IS" : "IS NOT"); } Actual result: -------------- 4 2 Parameter #0 (hour) IS NOT OPTIONAL Parameter #1 (minute) IS NOT OPTIONAL Parameter #2 (second) IS OPTIONAL Parameter #3 (microseconds) IS OPTIONAL