11# Contributing to PHP
22
33Anybody who programs in PHP can be a contributing member of the community that
4- develops and deploys it; the task of deploying PHP, documentation and
5- associated websites is a never ending one. With every release, or release
6- candidate comes a wave of work, which takes a lot of organization and
7- co-ordination.
4+ develops and deploys it; the task of deploying PHP, documentation and associated
5+ websites is a never ending one. With every release, or release candidate comes a
6+ wave of work, which takes a lot of organization and co-ordination.
7+
8+ You don't need any special access to download, build, debug and begin submitting
9+ PHP or PECL code, tests or documentation. Once you've followed this guide and
10+ had several contributions accepted, commit privileges are often quickly granted.
11+
12+ ## Index
13+
14+ * [ Pull requests] ( #pull-requests )
15+ * [ Filing bugs] ( #filing-bugs )
16+ * [ Feature requests] ( #feature-requests )
17+ * [ Writing tests] ( #writing-tests )
18+ * [ Writing documentation] ( #writing-documentation )
19+ * [ Getting help] ( #getting-help )
20+ * [ PHP source code directory structure] ( #php-source-code-directory-structure )
21+ * [ PHP internals] ( #php-internals )
22+ * [ PECL extensions] ( #pecl-extensions )
23+ * [ Checklist for submitting contribution] ( #checklist-for-submitting-contribution )
24+ * [ What happens after submitting contribution?] ( #what-happens-after-submitting-contribution )
25+ * [ What happens when your contribution is applied?] ( #what-happens-when-your-contribution-is-applied )
826
927## Pull requests
1028
@@ -13,18 +31,28 @@ implement RFCs. Please be sure to include tests as appropriate!
1331
1432If you are fixing a bug, then please submit your PR against the lowest actively
1533supported branch of PHP that the bug affects (only green branches on
16- [ the supported version page] ( http ://php.net/supported-versions.php) are supported).
17- For example, at the time of writing, the lowest supported version is PHP 7.2,
18- which corresponds to the ` PHP-7.2 ` branch in Git. Please also make sure you add
19- a link to the PR in the bug on [ the bug tracker] ( https://bugs.php.net/ ) .
34+ [ the supported version page] ( https ://www. php.net/supported-versions.php) are
35+ supported). For example, at the time of writing, the lowest supported version is
36+ PHP 7.2, which corresponds to the ` PHP-7.2 ` branch in Git. Please also make sure
37+ you add a link to the PR in the bug on [ the bug tracker] ( https://bugs.php.net/ ) .
2038
2139Pull requests implementing RFCs should be submitted against ` master ` .
2240
23- Pull requests should * never* be submitted against ` PHP-x.y.z ` branches, as
24- these are only used for release management.
41+ Pull requests should * never* be submitted against ` PHP-x.y.z ` branches, as these
42+ are only used for release management.
2543
26- If your pull request exhibits conflicts with the base branch, please resolve them
27- by using ` git rebase ` instead of ` git merge ` .
44+ If your pull request exhibits conflicts with the base branch, please resolve
45+ them by using ` git rebase ` instead of ` git merge ` .
46+
47+ Fork the official PHP repository and send a pull request. A notification will be
48+ sent to the pull request mailing list. Sending a note to PHP Internals list
49+ (internals@lists.php.net ) may help getting more feedback and quicker turnaround.
50+ You can also add pull requests to [ bug reports] ( https://bugs.php.net/ ) .
51+
52+ Read [ Git access page] ( https://www.php.net/git.php ) for help on using Git to get
53+ and build PHP source code. We recommend to look at our
54+ [ workflow] ( https://wiki.php.net/vcs/gitworkflow ) and our
55+ [ FAQ] ( https://wiki.php.net/vcs/gitfaq ) .
2856
2957## Filing bugs
3058
@@ -37,12 +65,19 @@ Where possible, please include a self-contained reproduction case!
3765## Feature requests
3866
3967Feature requests are generally submitted in the form of
40- [ Requests for Comment ] ( https://wiki.php.net/rfc/howto ) , ideally accompanied by
41- [ pull requests] ( #pull-requests ) . You can find the extremely large list of RFCs
42- that have been previously considered on the
68+ [ Requests for Comments (RFC) ] ( https://wiki.php.net/rfc/howto ) , ideally
69+ accompanied by [ pull requests] ( #pull-requests ) . You can find the extremely large
70+ list of RFCs that have been previously considered on the
4371[ PHP Wiki] ( https://wiki.php.net/rfc ) .
4472
45- You may want to read
73+ To create a RFC, discuss it with the extension maintainer, and discuss it on the
74+ development mailing list internals@lists.php.net . RFC Wiki accounts can be
75+ requested on https://wiki.php.net/start?do=register . PHP extension maintainers
76+ can be found in the [ EXTENSIONS] ( /EXTENSIONS ) file in the PHP source code
77+ repository. Mailing list subscription is explained on the
78+ [ mailing lists page] ( https://www.php.net/mailing-lists.php ) .
79+
80+ You may also want to read
4681[ The Mysterious PHP RFC Process] ( https://blogs.oracle.com/opal/entry/the_mysterious_php_rfc_process )
4782for additional notes on the best way to approach submitting an RFC.
4883
@@ -51,7 +86,11 @@ for additional notes on the best way to approach submitting an RFC.
5186We love getting new tests! PHP is a huge project and improving code coverage is
5287a huge win for every PHP user.
5388
54- [ Our QA site includes a page detailing how to write test cases.] ( http://qa.php.net/write-test.php )
89+ [ Our QA site includes a page detailing how to write test cases.] ( https://qa.php.net/write-test.php )
90+
91+ Submitting test scripts helps us to understand what functionality has changed.
92+ It is important for the stability and maintainability of PHP that tests are
93+ comprehensive.
5594
5695## Writing documentation
5796
@@ -72,7 +111,8 @@ issues.
72111
73112Although not a formal channel, you can also find a number of core developers on
74113the #php.pecl channel on [ EFnet] ( http://www.efnet.org/ ) . Similarly, many
75- documentation writers can be found on #php.doc.
114+ documentation writers can be found on #php.doc. Windows development IRC channel
115+ is available at #winphp-dev on FreeNode.
76116
77117## PHP source code directory structure
78118
@@ -173,3 +213,68 @@ locations.
173213 └─ ...
174214 └─ ...
175215```
216+
217+ ## PHP internals
218+
219+ For information on PHP internal C functions see
220+ [ References about Maintaining and Extending PHP] ( https://wiki.php.net/internals/references ) .
221+ Various external resources can be found on the web. A standard printed reference
222+ is the book "Extending and Embedding PHP" by Sara Golemon.
223+
224+ ## PECL extensions
225+
226+ If you are fixing broken functionality in a [ PECL] ( https://pecl.php.net )
227+ extension then create a bug or identify an existing bug at
228+ [ bugs.php.net] ( https://bugs.php.net ) . A bug can be used to track the change
229+ progress and prevent your changes getting lost in the PHP mail archives. Some
230+ PECL extensions have their own bug tracker locations and different contributing
231+ procedures.
232+
233+ If your change is large then create a
234+ [ Request for Comments (RFC)] ( https://wiki.php.net/rfc ) , discuss it with the
235+ extension maintainer, and discuss it on the development mailing list
236+ pecl-dev@lists.php.net depending on the extension. PECL mailing list
237+ subscription is explained on the
238+ [ PECL support page] ( https://pecl.php.net/support.php ) .
239+
240+ Update any open bugs and add a link to the source of your change. Send the patch
241+ or pointer to the bug to pecl-dev@lists.php.net . Also CC the extension
242+ maintainer. Explain what has been changed by your patch. Test scripts should be
243+ included.
244+
245+ ## Checklist for submitting contribution
246+
247+ - Read [ CODING_STANDARDS] ( /CODING_STANDARDS ) before you start working.
248+ - Update git source just before running your final ` diff ` and before testing.
249+ - Add in-line comments and/or have external documentation ready. Use only
250+ ` /* */ ` style comments, not ` // ` .
251+ - Create test scripts for use with ` make test ` .
252+ - Run ` make test ` to check your change doesn't break other features.
253+ - Rebuild PHP with ` --enable-debug ` which will show some kinds of memory errors
254+ and check the PHP and web server error logs after running your PHP tests.
255+ - Rebuild PHP with ` --enable-maintainer-zts ` to check your change compiles on
256+ multi-threaded web servers.
257+ - Review the change once more just before submitting it.
258+
259+ ## What happens after submitting contribution?
260+
261+ If your change is easy to review and obviously has no side-effects, it might be
262+ committed relatively quickly.
263+
264+ Because PHP is a volunteer-driven effort more complex changes will require
265+ patience on your side. If you do not receive feedback in a few days, consider
266+ bumping. Before doing this think about these questions:
267+
268+ - Did I send the patch to the right mailing list?
269+ - Did I review the mailing list archives to see if these kind of changes had
270+ been discussed before?
271+ - Did I explain my change clearly?
272+ - Is my change too hard to review? Because of what factors?
273+
274+ ## What happens when your contribution is applied?
275+
276+ Your name will likely be included in the Git commit log. If your change affects
277+ end users, a brief description and your name might be added to the [ NEWS] ( /NEWS )
278+ file.
279+
280+ Thank you for contributing to PHP!
0 commit comments