* Use FQCN for native attributes
For attributes, it's non-obvious that they need to be imported with `use` or
referenced with their FQCN, because applying a non-existent attribute is not an
error.
Make the examples copy-and-paste safe by adding the leading backslash, as
already done for `#[\SensitiveParameterValue]`.
The example code contained three errors:
* Reference to non-existent `ConstantTrait` trait (x2).
* Instantiation of non-existent `ConstantExample` class.
* Reference to an undefined constant.
Fixed now.
Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
Closes GH-2118.
The big one is the need to clarify the behaviour around the coercive typing mode, as the conversion of objects to strings is relatively straight forward but in theory internal objects that overload the cast handler can convert to other types too.
Drive-by typo fix
Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
This commit rewrites the whole type section to (hopefully) be better structured and future proof for further additions to the type system.
* Each type now gets their individual page instead of being shoved in the type declaration page.
* A type system page is added which describes PHP's type system, regardless if it is possible to declare the type in userland or not. Therefore, the type declaration page only has information related to writing type declarations in userland.
* The description of strict_type and the type coercion is moved into the type juggling page.
* Remove outdated information in string implementation section
* Add paragraph about using non string in string context can throw
Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
This will fix the fact that the examples start their number at 3.
The reason for that is the numbering starts within the previous ``<sect1>`` but this is not rendered on the page, but in a follow-up page.
However, we cannot put this sections after the ``<simplesect>`` as that doesn't respect the DTD: https://tdg.docbook.org/tdg/5.0/chapter.html
Converting them to <sect1>, however, makes them render into different pages.
Therefore, we use our custom PhD DTD: ``xmlns:phd="http://www.php.net/ns/phd"`` and use the ``<sect1 phd:chunk="false">`` tag which will keep the current behaviour of not splitting the pages.
Drop personalisation
Drop mention of specific HTTP headers and use a general statement instead
Various mark-up nits
Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
These backslashes were previously added in 214335df7e and cfaa7659da.
Backslashes before ReturnTypeWillChange in deprecation messages were left as-is, since those are quoting actual output from PHP. See 081cf71ecb for those messages.
In the current manual, the following is seen: "...if a very large objects...", where it should use the singular form. This PR fixes that so it becomes "...if a very large object...".
Closes GH-1736.