@@ -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
@@ -422,14 +420,13 @@ An Example from the git project (commit 2b34e486bc):
422420 'arg' variable no longer is available.
423421
424422If you fix some bugs, you should note the bug ID numbers in your commit message.
425- Bug ID should be prefixed by ` # ` .
426423
427424Example:
428425
429- Fixed bug #14016 (pgsql notice handler double free crash bug.)
426+ Fixed GH-14009: Fix prototype for trait method.
430427
431- When you change the NEWS file for a bug fix, then please keep the bugs sorted in
432- decreasing order under the fixed version.
428+ When you change the NEWS file for a bug fix, then please keep the bugs sorted
429+ under the fixed version.
433430
434431## Copyright and license headers
435432
@@ -453,4 +450,90 @@ New source code files should include the following header block:
453450*/
454451```
455452
453+ ## NEWS
454+
455+ The purpose of the NEWS file is to record all the changes that are relevant for
456+ users and developers alike. These could be bug fixes, feature additions, syntax
457+ additions, or deprecations.
458+
459+ ### Format
460+
461+ Each PHP version has a section, starting with the format:
462+
463+ {DD} {MMM} {YYY}, PHP {version}
464+
465+ Such as:
466+
467+ 06 Jun 2024, PHP 8.1.29
468+
469+ In each section, entries are ordered by their extension. Extensions are listed
470+ alphabetically, with the exception of "Core", which MUST be listed first. Each
471+ extension's section starts with: ` - {name}:\n `
472+
473+ For each extension, entries are indented by two spaces, followed by ` . ` (a
474+ period and a space).
475+
476+ Entries MUST start with a capital and end with a period (` . ` ). The period goes
477+ outside of the ` {issue-description} ` .
478+
479+ Each entry SHOULD be followed by the name of the contributor, their php.net
480+ account name, or their GitHub handle if they so choose.
481+
482+ Entries MUST be wrapped at 80 characters.
483+
484+ If an entry pertains a bug fix, they MUST be formatted as:
485+
486+ Fixed bug GH-{number} ({issue-description}). ({contributor})
487+
488+ Bug fix entries SHOULD be clustered together, and ordered according to their
489+ issue number. The ` {issue-description} ` SHOULD represent what the actual bug
490+ fix is about, and not necessarily what the user reported. Edit the description
491+ in the GitHub ticket to match.
492+
493+ On the rare occasion where a bug from our deprecated bug system is fixed, the
494+ entry MUST be formatted as:
495+
496+ Fixed bug #{number} ({issue-description}). ({contributor})
497+
498+ An example:
499+
500+ ```
501+ 31 Jul 2025, PHP 8.5.0alpha4
502+
503+ - Core:
504+ . Added PHP_BUILD_PROVIDER constant. (timwolla)
505+ . Fixed bug GH-16665 (\array and \callable should not be usable in
506+ class_alias). (nielsdos)
507+ . Fixed bug GH-19326 (Calling Generator::throw() on a running generator with
508+ a non-Generator delegate crashes). (Arnaud)
509+
510+ - OPcache:
511+ . Make OPcache non-optional. (Arnaud, timwolla)
512+
513+ - OpenSSL:
514+ . Add $digest_algo parameter to openssl_public_encrypt() and
515+ openssl_private_decrypt() functions. (Jakub Zelenka)
516+ ```
517+
518+ ### Branches
519+
520+ Depending on what sort of fix it is, or where in the release cycle we are,
521+ different NEWS files must be updated.
522+
523+ * Security fixes* : In the lowest security-supported branch which received the
524+ security fix, and in each newer branch, except for master unless alpha releases
525+ have been tagged, and a release branch has not been created.
526+
527+ * Bug fixes* : In the lowest supported branch, and in each newer branch, except
528+ for master unless alpha releases have been tagged, and a release branch has not
529+ been created.
530+
531+ * Feature additions* : In master only.
532+
533+ If for some reason a feature is introduced in a branch lower than master,
534+ although this is strictly prohibited by other policies, then the entry must
535+ also be in master.
536+
537+ ## Thanks
538+
456539Thank you for contributing to PHP!
0 commit comments