php/php-src — pull request #882 by Rican7 (2014-10-30 06:54:00+00:00)
Title: Feature - DateTime RFC7231 constant

## Introduction

The [DateTime class][php-datetime] has a set of defined constants for different standard formats. These format constants prove to be really quite helpful in providing a consistent format of date/time strings to date fields, parsers, and formatters.

While most relevant standard "internet" and network message formats have been included here, there is one glaring omission: RFC7231.

[RFC 7231, Section 7.1.1.1][rfc7231-section-7.1.1.1], defines a new "HTTP-date" format to be used in date headers. While similar to previous formats, the format is in fact a new definition, of which is specified in the RFC document.

This PR defines a new DateTime constant for this format.

## Proposal

This PR proposes to add two new constants with the new defined format, to comply with the current format constant definition style:

- `DATE_RFC7231`
- `DateTime::RFC7231`

The defined format of these constants would be identical to each other. In a [PHP date format string][php-date-format], the format would be defined as:

`'D, d M Y H:i:s \G\M\T'`

## Backward Incompatible Changes

Since this would define a single new global constant (`DATE_RFC7231`), this change may effect anyone that's defined their own constant for this format. Hence why I think its most appropriate for this PR to be targeted for PHP.next (PHP 7) in the current master branch.

## Proposed PHP Version(s)

PHP.next (PHP 7)

## Affected PHP Functionality

### To SAPIs

None

### To Existing Extensions

None

### To Opcache

None

### New Constants

Two new constants would be defined here, one class-scoped and one global.

[php-datetime]: http://php.net/manual/en/class.datetime.php
[rfc7231-section-7.1.1.1]: https://tools.ietf.org/html/rfc7231#section-7.1.1.1
[php-date-format]: http://php.net/manual/en/function.date.php#refsect1-function.date-parameters