Doc #78000 [NEW]: Description of reltext behavior

From: Date: Fri, 10 May 2019 14:22:03 +0000
Subject: Doc #78000 [NEW]: Description of reltext behavior
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-16644@lists.php.net to get a copy of this message
From: ssimo3 at lsuhsc dot edu Operating system: Windows 10 x64 PHP version: 7.3.5 Package: Date/time related Bug Type: Documentation Problem Bug description:Description of reltext behavior Description: ------------ --- From manual page: https://php.net/datetime.formats.relative --- What is missing is the following paragraph: "The referent of the reltext keywords depend on the context in which the relative format string is used. If used with a static method or function, the referent is the current system timestamp. However, if used in DateTime::modify() or DateTimeImmutable::modify(), the referent is the object on which the modify() method is called." Thank you! Test script: --------------- <?php header("Content-Type: text/plain"); $thisMonthDateTime = date_create("first day of this month"); echo $thisMonthDateTime->format("Y-m-d") . "\r\n"; $januaryDateTime = DateTime::createFromFormat("Y-m-d", "2019-01-15"); $januaryDateTime->modify("first day of this month"); echo $januaryDateTime->format("Y-m-d"); Actual result: -------------- The two displayed dates are different, AS THEY SHOULD BE. What is missing is DOCUMENTATION of the behavior. -- Edit bug report at https://bugs.php.net/bug.php?id=78000&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=78000&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=78000&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=78000&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=78000&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=78000&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=78000&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=78000&r=needscript Try newer version: https://bugs.php.net/fix.php?id=78000&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=78000&r=support Expected behavior: https://bugs.php.net/fix.php?id=78000&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=78000&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=78000&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=78000&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=78000&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=78000&r=dst IIS Stability: https://bugs.php.net/fix.php?id=78000&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=78000&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=78000&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=78000&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=78000&r=mysqlcfg

« previous php.doc.bugs (#16644) next »