1
0
mirror of https://github.com/php/doc-en.git synced 2026-03-23 23:32:18 +01:00

2857 Commits

Author SHA1 Message Date
Kevin DeCapite
5744be5a4d Add strict inequality check for Suit enumeration
The paragraph above explicitly states that "cases are not intrinsically backed by a scalar value"; this example demonstrates that more clearly than the others.
2026-03-23 11:59:21 +01:00
Gina Peter Banyard
8f51247cb4 Move __sleep()/__wakeup() after __serialize()/unserialize() (#5427)
This is part of https://wiki.php.net/rfc/soft-deprecate-sleep-wakeup
2026-03-16 14:12:11 +00:00
Máté Kocsis
0eb433f1de Add missing constant tag for $flags param of Attribute::__construct() 2026-03-08 21:16:05 +01:00
Máté Kocsis
462d2bcb3f Revert "Fix wrong xml:id on the fieldsynopsis element of Exception::$code"
This reverts commit 6a05d92a32.

The id is needed since 3c4752c0ae
2026-03-05 14:21:25 +01:00
Máté Kocsis
6a05d92a32 Fix wrong xml:id on the fieldsynopsis element of Exception::$code 2026-03-05 13:48:51 +01:00
Máté Kocsis
30bda33771 Fix missing attribute for NoDiscard 2026-03-05 13:46:32 +01:00
sasezaki
02bee41067 Add NoDiscard attribute (#5041)
Co-authored-by: Gina Peter Banyard <girgias@php.net>
2026-02-27 06:49:08 -08:00
Daniel Scherzer
88eb0d53c6 property-hooks: add missing $modified declaration to example 4 (#5124) 2026-02-17 10:25:16 -08:00
Karoly Negyesi
31e56c25f9 add literal around getcurrent error 2026-02-06 17:33:25 +01:00
Máté Kocsis
5e36b489fc Add some missing properties and constants (intl/soap/attribute) (#5069) 2026-02-06 14:15:34 +00:00
Samuel
53fb200fed do-while: align example code indentation (#5278) 2026-02-06 01:00:26 -08:00
Karoly Negyesi
f6406cdb5e add error message, use yoda style you should not 2026-02-05 12:30:30 +01:00
Karoly Negyesi
6fc2c24b6b no need for these see also 2026-02-02 17:24:34 +01:00
Karoly Negyesi
d74f3573b3 document getcurrent 2026-02-02 09:34:00 +01:00
Louis-Arnaud
7fbb16f538 Extend Iterator::rewind note to mention NoRewindIterator (#5110) 2026-01-30 10:33:05 +00:00
Louis-Arnaud
6b413423c7 Clarify REQUEST_TIME initialization timing (#5109) 2026-01-30 10:13:21 +00:00
Vadim Dvorovenko
a7428462fe Describe precedence for pipe and throw operators (#5083)
* Throw operator precedence

* Pipe operator precedence

* Update language/operators/precedence.xml

Co-authored-by: Larry Garfield <larry@garfieldtech.com>

---------

Co-authored-by: Larry Garfield <larry@garfieldtech.com>
2026-01-15 10:23:32 +01:00
Alexander Krause
5e6944e79f Fix Generator::rewind() docs to match actual behavior (#5031)
Clarify rewind() semantics to prevent misunderstandings about
generator-specific behavior.
2026-01-11 20:26:58 +00:00
Larry Garfield
b9af4bd4ee Document static asymmetric visibility. (#4891)
* Document static asymmetric visibility.

* Formatting fixes

Co-authored-by: Gina Peter Banyard <girgias@php.net>

* Add output.

* Add marker

Co-authored-by: Kamil Tekiela <tekiela246@gmail.com>

* Fix example structure.

* Whitespace

Co-authored-by: Kamil Tekiela <tekiela246@gmail.com>

---------

Co-authored-by: Gina Peter Banyard <girgias@php.net>
Co-authored-by: Kamil Tekiela <tekiela246@gmail.com>
2026-01-09 12:07:38 -06:00
Leo BONAZ
78a11d3ca0 Deprecated non-canonical cast names (#5016) 2026-01-09 01:56:03 +00:00
Máté Kocsis
77325b622f Add missing attributes (#5067) 2026-01-02 14:37:19 +01:00
AllenJB
3061900171 Array type: Add a top of page link to the array functions docs (#4654) 2025-12-25 16:31:07 +00:00
Luffy
eb8957c4fd Add changelog entry for deprecation of backtick operator in PHP 8.5.0 (#5017) 2025-12-07 17:46:55 +08:00
Derick Rethans
2f18122175 Fixed example so that it runs 2025-11-27 16:42:15 +00:00
Kamil Tekiela
3f1dbc451b Remove <para> in invalid places (#4999) 2025-11-15 02:02:26 +00:00
Jakub Vrana
801e7a15e8 Add an example of indirectly modifying readonly property 2025-11-06 14:48:24 +01:00
Gina Peter Banyard
fcf847c112 Mark $http_response_header as deprecated (#4977) 2025-11-05 21:36:51 +00:00
Gina Peter Banyard
312c0c7b39 Fix indentation 2025-11-04 05:36:31 +00:00
Yoshinari Takaoka
87fd768a70 Added programlisting role for syntax highlighting for "coerce into union type" example. (#4901) 2025-11-03 15:37:46 +00:00
Kamil Tekiela
147b80d197 Rewrite the callback and callable page (#4933)
* Rewrite the callback and callable page

* Remove English ambiguity

* Add arrow function example for callables

* Add one more example

* Add space after function

* Replace <para> with <simpara>

* Add "magic method"

* Remove exit which became a function

* Rewrite second paragraph

* Revert back to PHP_EOL

* Update language/types/callable.xml

Co-authored-by: Tim Düsterhus <timwolla@googlemail.com>

* Update language/types/callable.xml

Co-authored-by: Gina Peter Banyard <girgias@php.net>

* Update language/types/callable.xml

Co-authored-by: Gina Peter Banyard <girgias@php.net>

* Update language/types/callable.xml

Co-authored-by: Gina Peter Banyard <girgias@php.net>

* Update language/types/callable.xml

Co-authored-by: Gina Peter Banyard <girgias@php.net>

* Update language/types/callable.xml

Co-authored-by: Gina Peter Banyard <girgias@php.net>

* Update language/types/callable.xml

Co-authored-by: Gina Peter Banyard <girgias@php.net>

* Update language/types/callable.xml

Co-authored-by: Gina Peter Banyard <girgias@php.net>

* Update language/types/callable.xml

Co-authored-by: Gina Peter Banyard <girgias@php.net>

* Add indentation

* Use type snippets

* Fix typo

* Add alternative property type declaration

---------

Co-authored-by: Tim Düsterhus <timwolla@googlemail.com>
Co-authored-by: Gina Peter Banyard <girgias@php.net>
2025-10-31 09:30:09 -04:00
Sebastian Hädrich
eac9eff7b6 Add note about first-class callables to callable type and add link to the closure documentation page (#4792) 2025-10-16 00:43:01 +01:00
Juliette
3a97501ec4 Type juggling: fix incorrect deprecation version info for (real) (#4929)
Page: https://www.php.net/manual/en/language.types.type-juggling.php#language.types.typecasting

The `(real)` cast was deprecated in PHP 7.4 and removed in PHP 8.0.

Refs:
* https://wiki.php.net/rfc/deprecations_php_7_4#the_real_type
* https://www.php.net/manual/en/migration74.deprecated.php#migration74.deprecated.core.real

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
2025-10-15 10:49:08 +02:00
Jamie Calder
fc068b4857 Update default value to 'Parent Class' in XML (#4902)
The output being displayed was incorrect.
2025-10-12 22:43:55 +01:00
Gina Peter Banyard
2c62a67763 Minor markup-fixes to Override attribute page (#4920) 2025-10-12 17:49:15 +01:00
Luffy
f90b26b377 Update default values for opcache.jit settings (#4900) 2025-10-12 09:07:02 +08:00
Larry Garfield
c999c7066e Typographic fixes. (#4909) 2025-10-07 17:56:58 -05:00
Larry Garfield
2946c8a267 Document the pipe operator. (#4890) 2025-10-06 11:46:32 -05:00
Jiří Pudil
9d31699614 Override: document usage with properties (PHP 8.5) (#4821) 2025-10-03 13:01:07 -05:00
Takuya Aramaki
094816bd17 Undefined constant throws an error instead of E_NOTICE (#4828) 2025-10-03 10:13:42 -05:00
MorganLOCode
0ece873cec Update declarations.xml (#4876)
The bottom type can't be used in a composite type for the same (rather, dual) reason the top type can't.
2025-10-03 10:06:01 -05:00
Pere Orga
f56de7ebe7 Improve $_POST/$_GET definition (#4522)
* Improve $_POST/$_GET definition

* end example sentences with a dot

* $_GET: apply suggestions

* Do not use title case in refpurpose

* docs(post): reference php://input

* docs(php://input): provide example to read JSON data

* fix format in previous commits

* docs: apply suggestions

* docs: remove try/catch and improve variable names in example
2025-10-03 09:49:27 -05:00
Hendrik Becker
5c04cf0fd6 add missing string type for $title in Asymmetric Property inheritance example (#4833)
Add the missing string type to $title in the SpecialBook class. The parent defines $title as string; the child must not drop the declared type.
2025-10-03 09:40:45 -05:00
Daniel Scherzer
ba7093cf7f Fix example code for skipping array elements (#4851) 2025-08-28 08:49:10 +08:00
Annika Backstrom
2e5f2910f3 enumerations: Cleanup dangling line in description of backed cases (#4842)
Small cleanup to remove a dangling `is not.` from previous cleanup #4413
2025-08-26 09:06:22 -07:00
Tisza Gergő
eaec4ab10a Fix type juggling notes for list() and array destructuring (#3680)
Update notes about the handling of missing keys and non-arrays
during array destructuring to match the behavior seen on
3v4l.org, which doesn't issue a warning or notice in some cases
where the documentation claims it does. Also update list() docs
to provide the same information.

list():
* missing key: https://3v4l.org/bYBt6
* destructuring an integer: https://3v4l.org/7lNhK
* a boolean: https://3v4l.org/p5LDd
* a string: https://3v4l.org/KHSAH
* null: https://3v4l.org/lk1iu

array notation:
* missing key: https://3v4l.org/KCiTC
* destructuring an integer: https://3v4l.org/louVG
* a boolean: https://3v4l.org/SWL5L
* a string: https://3v4l.org/aK90L
* null: https://3v4l.org/Y8cOY

Fixes #3640.
2025-08-23 22:30:09 -07:00
Karoly Negyesi
e8600fec14 Name the spread operator 2025-07-18 15:50:25 +02:00
rcanavan
c81a48e58f language/exceptions.xml: add missing "be" (#4766)
Co-authored-by: Rainer M. Canavan <rainer.canavan@avenga.com>
2025-07-08 16:04:22 -07:00
Christian Flothmann
565bd8b6cf Fix typo (#4761)
Co-authored-by: Luffy <lufei@php.net>
2025-07-07 11:19:51 +08:00
Grégoire Paris
ed956d714e Document exception chaining (#3855)
This is already documented as a user note, but the note does not explain
what happens if both exceptions already have a previous exception.

Here is what I believe is the related piece of code:

```
/* Chain potential exception from wrapping finally block */
if (Z_OBJ_P(fast_call)) {
	if (ex) {
		if (zend_is_unwind_exit(ex) || zend_is_graceful_exit(ex)) {
			/* discard the previously thrown exception */
			OBJ_RELEASE(Z_OBJ_P(fast_call));
		} else {
			zend_exception_set_previous(ex, Z_OBJ_P(fast_call));
		}
	} else {
		ex = EG(exception) = Z_OBJ_P(fast_call);
	}
}
```

The note: https://www.php.net/manual/en/language.exceptions.php#129177
2025-06-23 14:41:19 -07:00
DanielEScherzer
1651836ff3 Namespaces: note that enums are affected (#4739)
Co-authored-by: Tim Düsterhus <timwolla@googlemail.com>
2025-06-22 11:38:42 -07:00