@@ -26,6 +26,7 @@ had several contributions accepted, commit privileges are often quickly granted.
2626* [ What happens when your contribution is applied?] ( #what-happens-when-your-contribution-is-applied )
2727* [ Git commit rules] ( #git-commit-rules )
2828* [ Copyright and license headers] ( #copyright-and-license-headers )
29+ * [ NEWS file] ( #news )
2930
3031## Pull requests
3132
@@ -385,11 +386,8 @@ The next few rules are more of a technical nature:
385386 later branches) an empty merge should be done.
386387
3873882 . All news updates intended for public viewing, such as new features, bug
388- fixes, improvements, etc., should go into the NEWS file of * any stable
389- release* version with the given change. In other words, news about a bug fix
390- which went into PHP-5.4, PHP-5.5 and master should be noted in both
391- PHP-5.4/NEWS and PHP-5.5/NEWS but not master, which is not a public released
392- version yet.
389+ fixes, improvements, etc., should go into the NEWS file. See the section on
390+ [ NEWS] ( #news ) below.
393391
3943923 . Do not commit multiple files and dump all messages in one commit. If you
395393 modified several unrelated files, commit each group separately and provide a
@@ -426,7 +424,7 @@ Bug ID should be prefixed by `#`.
426424
427425Example:
428426
429- Fixed bug #14016 (pgsql notice handler double free crash bug.)
427+ Fixed bug #14016 (pgsql notice handler double free crash bug).
430428
431429When you change the NEWS file for a bug fix, then please keep the bugs sorted in
432430decreasing order under the fixed version.
@@ -453,4 +451,82 @@ New source code files should include the following header block:
453451*/
454452```
455453
454+ ## NEWS
455+
456+ The purpose of the NEWS file is to record all the changes that are relevant for
457+ users and developers alike. These could be bug fixes, feature additions, syntax
458+ additions, or deprecations.
459+
460+ ### Format
461+
462+ Each PHP version has a section, starting with the format:
463+
464+ {DD} {MMM} {YYY}, PHP {version}
465+
466+ Such as:
467+
468+ 06 Jun 2024, PHP 8.1.29
469+
470+ In each section, entries are ordered by their extension. Extensions are listed
471+ alphabetically, with the exception of "Core", which MUST be listed first. Each
472+ extension's section starts with: ` - {name}:\n `
473+
474+ For each extension, entries are indented by two spaces, followed by ` . ` (a
475+ period and a space).
476+
477+ Entries MUST start with a capital and end with a period (` . ` ). The period goes
478+ outside of the ` {issue-description} ` .
479+
480+ Each entry SHOULD be followed by the name of the contributor, or their GitHub
481+ handle if they so choose.
482+
483+ Entries MUST be wrapped at 80 characters.
484+
485+ If an entry pertains a bug fix, they MUST be formatted as:
486+
487+ Fixed bug GH-{number} ({issue-description}). ({contributor})
488+
489+ Bug fix entries SHOULD be clustered together, and ordered according to their
490+ issue number. The ` {issue-description} ` SHOULD represent what the actual bug
491+ fix is about, and not necessarily what the user reported. Edit the description
492+ in the GitHub ticket to match.
493+
494+ An example:
495+
496+ ```
497+ 31 Jul 2025, PHP 8.5.0alpha4
498+
499+ - Core:
500+ . Added PHP_BUILD_PROVIDER constant. (timwolla)
501+ . Fixed bug GH-16665 (\array and \callable should not be usable in
502+ class_alias). (nielsdos)
503+ . Fixed bug GH-19326 (Calling Generator::throw() on a running generator with
504+ a non-Generator delegate crashes). (Arnaud)
505+
506+ - OPcache:
507+ . Make OPcache non-optional (Arnaud, timwolla)
508+
509+ - OpenSSL:
510+ . Add $digest_algo parameter to openssl_public_encrypt() and
511+ openssl_private_decrypt() functions. (Jakub Zelenka)
512+ ```
513+
514+ ### Branches
515+
516+ Depending on what sort of fix it is, or where in the release cycle we are,
517+ different NEWS files must be updated.
518+
519+ * Security fixes* : In the lowest security-supported branch, and in each newer
520+ branch, except for master.
521+
522+ * Bug fixes* : In the lowest supported branch, and in each newer branch, except
523+ for master.
524+
525+ * Feature additions* : In master only.
526+
527+ If for some reason a feature is introduced in a branch lower than master (this
528+ isn't strictly allowed), then the entry must also be in master.
529+
530+ ## Thanks
531+
456532Thank you for contributing to PHP!
0 commit comments