34 Commits
Author SHA1 Message Date
Gina Peter BanyardandArnaud Le Blanc 2f7b01b86c Zend: always populate error pointer on failure of zend_is_callable() (#24435)
* Zend: always populate error pointer on failure

Most of the code base expects an error to be set if a char* is provided, as this used to be always the case. It no longer was the case since the partially supported callables were deprecates as the deprecation could be promoted to an exception in which case we skipped allocating a char*.

The simple fix, allocate a char* even in case of an exception so callers don't need to check if it still NULL. This fixes some error messages at the same time.

* tree: simplify error handling for failed zend_is_callable() calls

* docs: clarify docs for zend_is_callable()

---------

Co-authored-by: Arnaud Le Blanc <365207+arnaud-lb@users.noreply.github.com>
2026-10-20 17:59:02 +01:00
Rafia Minhaj 03108515a6 [skip ci] Fix typos in PHP internal documentation (#24334)
- writing-tests.rst: Infact -> In fact
- writing-tests.rst: isnt't -> isn't
- fci-fcc.rst: transfered -> transferred
2026-10-14 22:18:14 +02:00
Gina Peter BanyardandArnaud Le Blanc 4a41768eec docs: write docs for FCI/FCC structs and PHP callables API. (#23663)
Partly based on my own writing for the PHP Internals Book:

- https://github.com/phpinternalsbook/PHP-Internals-Book/pull/135
- https://github.com/phpinternalsbook/PHP-Internals-Book/pull/137
- https://github.com/phpinternalsbook/PHP-Internals-Book/pull/146

Co-authored-by: Arnaud Le Blanc <arnaud.lb@gmail.com>
2026-10-11 23:04:28 +01:00
NickSdot 1f1570906e docs: Clarify --CREDITS-- section (GH-23215) 2026-08-11 12:06:12 +02:00
NickSdot 1d2ea5ce22 Run tests in parallel by default (#22939)
Runs the test suite in parallel by default; automatically selects up to 10 workers. Explicit -j1 remains the opt-out to run tests serial. Smaller batches improve balancing.
2026-08-10 11:33:43 +02:00
NickSdot c5cdea5ada docs/source/miscellaneous/writing-tests.rst: remove misplaced "is" (#22904) 2026-07-27 15:16:34 -07:00
Weilin Du 8334703dd9 CI: Fix writing-tests.rst format to pass doc rstfmt CI
This fixes https://github.com/php/php-src/actions/runs/30206101130/job/89804320499?pr=22799
2026-07-27 00:00:35 +08:00
Weilin Du 904698716e [skip ci] Fix typo in writing-tests.rst 2026-07-18 03:48:51 +08:00
Weilin Du 838a9c2ef8 Doc: Fix typo in zend_string.rst documentation 2026-07-12 00:11:52 +08:00
Weilin Du 6e20480250 Doc: Rename ZSTR_INIT to ZSTR_INIT_LITERAL in documentation
We don't have a macro named ZSTR_INIT. This should be ZSTR_INIT_LITERAL instead.
2026-07-11 17:06:34 +08:00
Weilin Du 44b11b75f2 ext/Intl: Fix IntlIterator::current() on invalid iterators (#22495)
IntlIterator::current() could expose an undefined zval when called before
theiterator is positioned, or after the iterator becomes invalid.

In these cases we directly returns the undefined zval and cause to a UNKNOWN:0
output in userland. Generally, a NULL output would be more proper.
2026-06-28 17:36:38 +08:00
Daniel Scherzer f97ff59742 zend_string docs: add missing apostrophe
[skip ci]
2026-05-27 15:15:22 -07:00
Djim Schaap 81ef9770be Fix typo in writing-tests.rst (GH-21133) 2026-02-04 23:03:29 +01:00
Weilin Du 4f793ba1c3 [skip ci] Fix duplicate words typos (GH-20800) 2025-12-31 02:22:09 +01:00
René Schleusner 26e0bfa341 Fixed some typos in docs and fpm pool config (GH-20587)
* Fix some typos in docs

* Fix typo in output header example of fpm pool config
2025-12-05 20:20:40 +01:00
Gina Peter Banyard 9b27fdbe52 Normalize version number strings 2025-08-24 12:00:31 +01:00
Gina Peter Banyard fb27ff958c Clarify usage of @deprecated annotation in stubs
To indicate that this was used prior to the \Deprecated attribute being usable on those symbols.
2025-08-24 12:00:31 +01:00
Derick Rethans a9ab62d54d Add a brief section on options to the test runner, and -j 2025-08-06 10:05:27 +01:00
Derick Rethans 0c82801384 Setting TEST_PHP_EXECUTABLE hasn't been necessary for ages. 2025-08-06 09:48:46 +01:00
DanielEScherzer 3f03f7ed3d [RFC] Add support for attributes on compile-time constants
https://wiki.php.net/rfc/attributes-on-constants
2025-04-29 11:53:09 -07:00
Derick Rethans 0029d2b08b Turn off font ligatures in code in documentation 2025-04-25 10:30:43 +01:00
Derick Rethans 681ef77734 Convert https://qa.php.net/running-tests.php 2025-04-25 10:09:52 +01:00
Derick Rethans eb048ce0c6 Add samples from original QA site 2025-04-25 10:09:52 +01:00
Derick Rethans ec288b1b07 Convert https://qa.php.net/write-test.php and https://qa.php.net/phpt_details.php 2025-04-25 10:09:52 +01:00
John Bampton 4e44efaccb docs: fix spelling in stubs.rst (GH-18220) 2025-04-01 12:51:02 +02:00
DanielEScherzer 1a468b6efc Docs: add a page about zend_constant (GH-17072) 2025-02-14 12:49:57 +01:00
hakre 1668a1602a Improve php-src docs sphinx build, also on *nix (GH-16743)
* Document .rst file maximum line length of 100

In 19d2b84788 ("Create book for docs", 2024-01-30) the build of the
php-src documentation has been introduced.

It is based on reStructuredText (rst) [Docutils] for its source files,
this stems from the sphinx-build utility in use to build the static HTML
pages of the php-src documentation.

The maximum line length of these text files has been set to 100
characters in 19d2b84788 ("Create book for docs", 2024-01-30), the
rationale is unknown to the documenting author at time of writing this
message.

This formatting constraint is applied with the rstfmt utility [rstfmt]
via its invocation (documented in CI build instructions and README.md:)

    rstfmt -w 100 source

The `-w, --width` option takes a WIDTH argument that is "the
target line length in characters" (cf. `rstfmt --help`.)

There is also an `--ext EXT` argument option, that is "the extension of
files to look at when passed a directory" ("source" is the name of
a directory in the invocation above) and defaults to "rst".

Henceforth, the editor configuration [EditorConfig] can benefit from
documenting this expectation in the repositories .editorconfig file,
which has been introduced already earlier in 5c38fbe543 ("Added
editorconfig file", 2016-06-26).

[Docutils]: https://docutils.sourceforge.io/index.html "Docutils: Documentation Utilities — Written in Python, for General- and Special-Purpose Use"
[rstfmt]: https://github.com/dzhu/rstfmt "A formatter for reStructuredText"
[EditorConfig]: https://editorconfig.org/ "EditorConfig helps maintain consistent coding styles for multiple developers working on the same project across various editors and IDEs"

* Makefile for php-src docs build

In 19d2b84788 ("Create book for docs", 2024-01-30) the php-src
documentation (php-src docs) build has been introduced, yet the build
instructions, namely `make html`, did not yield the expected results
within the parenting setup of the php-src project on *nix systems.

The reason is that the `make html` build instruction does not execute
the make.bat file which contains the recipe to build the static HTML
pages.

It is an unused leftover file from initializing the project with
sphinx-quickstart. [1]

Removing it in and adding a Makefile suffices to recover the build of
php-src ./docs on a *nix system.

Formatting constraints checked in the docs workflow in CI update
use the make file to make sure the commands stay consistent and the
build is managed by the build manager.

[1]: https://www.sphinx-doc.org/en/master/man/sphinx-quickstart.html "sphinx-quickstart is an interactive tool that asks some questions about your project and then generates a complete documentation directory and sample Makefile to be used with sphinx-build(1)."

* Bind requirements.txt for php-src docs build

Define the required packages to install for the php-src docs build in
the docs/requirements.txt file:

1) Sphinx
2) sphinx-design
3) sphinxawesome-theme
4) rstfmt

This should also later on ease the use of a requirements_frozen.txt
file to pin the build dependencies if needed/wanted.

Additionally, some formatting corrections in README.md (based on the
profile in .editorconfig) as well as adding the recommendation to use
a Python virtual environment. Python3 and Pip were already named, and
with Python3 there is the venv module (Python 3.3; Sep 2012) to manage
these so-called python virtual environments [venv], which are commonly
a preferred way to install dependencies within development projects
and build systems.

[venv]: https://docs.python.org/3/library/venv.html "venv — Creation of virtual environments — Python documentation"

* Remove deprecated theme configuration

For the configured Awesome Sphinx Theme [1] highlighting extension, the
sphinx-build currently yields the following diagnostics:

     WARNING: while setting up extension sphinxawesome_theme.highlighting: \
     You no longer have to include the `sphinxawsome_theme.highlighting` \
     extension. This extension will be removed in the next major release.

(via `make html`, the configuration file is `source/conf.py`.)

The diagnostic message was introduced by sphinxawesome-theme 5.2.0,
  released May 31, 2024. [2], [3]

Removing the extension from the list of extensions in the configuration
file levitates.

No changes to requirements.txt, the extension was transitive as bundled
by the Awesome Sphinx Theme [1], and 5.2.0 deprecates it with the new
feature to "Support `pygments_style_dark` option that allows you to set
a different syntax highlighting scheme in light and dark modes." [3]

[1]: https://sphinxawesome.xyz/ "Awesome Sphinx Theme — Create functional and beautiful websites for your documentation with Sphinx."
[2]: https://pypi.org/project/sphinxawesome-theme/5.2.0/#history
[3]: https://github.com/kai687/sphinxawesome-theme/releases/tag/5.2.0
2024-11-29 19:29:00 +01:00
Christophe Coevoet d411fdf615 Fix rST markup in the documentation about stubs (GH-16888) 2024-11-26 17:02:14 +01:00
DanielEScherzer 4a4574290f [skip ci] docs: fix constant syntax in stubs.rst (#15785)
Constants are declared with `=` not `:`
2024-09-07 08:22:10 +01:00
Máté KocsisandDerick Rethans 0f64901316 Document stubs (#13677)
Co-authored-by: Derick Rethans <github@derickrethans.nl>
2024-05-29 14:18:22 +02:00
Máté Kocsis 53de62561d Fix some typos on the reference counting docs page 2024-04-30 22:16:45 +02:00
Ilija Tovilo 1bef861527 Add vscode chapter to docs
Closes GH-13441
2024-02-21 14:42:08 +01:00
Ilija Tovilo a4dfa35f93 Fix docs typo 2024-02-18 20:31:54 +01:00
Ilija Tovilo 19d2b84788 Create book for docs
Closes GH-13338
2024-02-18 12:16:31 +01:00