php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #65762 Example citing use of constant is slightly inaccurate
Submitted: 2013-09-25 22:07 UTC Modified: 2013-09-25 22:34 UTC
From: ben at indietorrent dot org Assigned: aharvey (profile)
Status: Closed Package: Documentation problem
PHP Version: 5.4.20 OS: Windows
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: ben at indietorrent dot org
New email:
PHP Version: OS:

 

 [2013-09-25 22:07 UTC] ben at indietorrent dot org
Description:
------------
---
From manual page: http://www.php.net/function.date
---

The example that demonstrates the use of a constant appears to be inaccurate:

<?php
/* use the constants in the format parameter */
// prints something like: Mon, 15 Aug 2005 15:12:46 UTC
echo date(DATE_RFC822);
?>

This actually prints something like the following:

Wed, 25 Sep 13 17:56:44 -0400

(notice that the last segment is the timezone *offset*, not the timezone 
abbreviation, as the comment in the example states).

However, the manual entry is correct (only the example is incorrect).


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-09-25 22:13 UTC] ben at indietorrent dot org
Not to nitpick, but the example is incorrect in another way: it 
demonstrates the use of DATE_RFC822, but the sample output is actually from 
DATE_RFC2822. The former includes a two-digit years, whereas the latter includes a 
four-digit year.
 [2013-09-25 22:33 UTC] aharvey@php.net
Automatic comment from SVN on behalf of aharvey
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=331494
Log: Fix incorrect date() example.

Fixes doc bug #65762 (Example citing use of constant is slightly inaccurate).
 [2013-09-25 22:34 UTC] aharvey@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: aharvey
 [2013-09-25 22:34 UTC] aharvey@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Tue Oct 06 03:00:02 2026 UTC