Commit graph

2335 commits

Author SHA1 Message Date
Kamil Tekiela
16a1bdfd1c
Remove double words (#540) 2021-04-20 12:54:54 +02:00
AllenJB
1fb0ef23d7
Fix #80942: Object iteration / Iterator: Replace duplicated examples with direct links
* Object iteration / Iterator: Replace duplicated examples with direct links to the appropriate sections and add cross-links.

Closes GH-517.
2021-04-20 11:28:39 +02:00
Larry Garfield
bf28a4ce4f
Describe WeakMaps (#479)
Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
2021-04-13 23:59:11 +02:00
Kim Hallberg
c07214dc9c
Fix attributes overview example emitting E_WARNING (#522)
Fix `targetDirectoryExists` method in example emits E_WARNING if `$targetDirectory` already exists.

Reference:
- https://www.php.net/manual/en/function.mkdir.php

Co-authored-by: Kamil Tekiela <tekiela246@gmail.com>
2021-04-13 18:57:58 +02:00
Larry Garfield
68a416eeb7
Remove old weakref extension (#514)
* Remove old weakref extension that no longer works and namespace conflicts with WeakMap in PHP 8.
2021-04-12 15:35:52 +02:00
Guilliam Xavier
011596bcff
Fix/update operators.precedence (#509)
- explain why associativity is not applicable to unary operators
- distinguish between unary and binary `+`/`-`
- add some missing reference links
- update the precedence of string concatenation for PHP 8
- fix "(n/a)" ("not applicable") to "non-associative" for ternary

References:
- https://github.com/php/php-src/blob/master/Zend/zend_ast.c
  (search "Operator Precedence")
- https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y
  (search "precedence")
  (NOTE: in opposite order)
2021-04-12 14:37:34 +02:00
codedokode
2f79a80776
Fix list of falsy values (#519)
There is no integer -0 (minus zero)
2021-04-12 13:55:35 +02:00
Rowan Tommins
fe18943c11
Fix half-deleted sentence about "new" and reference assignment (#520)
This had a stray ")", and was left with a misleading half-sentence
about "new" returning a reference, which it doesn't.
2021-04-12 13:28:11 +02:00
Tom Sullivan
165718f97f
Remove errant , (#516) 2021-04-08 11:55:42 +02:00
Juliette
4a21d28c5b
Language Ref/Traits: fix incorrect information about abstract methods (#510)
As of PHP 8.0, `abstract private` methods are allowed in `trait`s. `abstract public` method were previously already supported.

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
2021-04-05 18:43:19 +02:00
Yoshinari Takaoka
b694d83ae9 added Stringable version info. 2021-04-02 17:10:06 +09:00
Larry Garfield
069ce7647c
Document Stringable interface 2021-04-01 23:26:42 +02:00
Larry Garfield
3ddc88b836
Note changes in how private methods inherit. (#481) 2021-04-01 23:21:32 +02:00
Christoph M. Becker
e49940b757
Fix #73938: PHP7 foreach internal array pointer 2021-03-31 16:09:52 +02:00
rochdiNassah
c630570335 Fix Typo
Closes GH-503.
2021-03-25 18:30:31 +01:00
Mike Lehan
175b731219 Clarify that Exception::getPrevious may return a Throwable
Spotted this when using PhpStorm's documentation which incorrectly typehints an Exception - use of this as Exception could cause a TypeError if a non-Exception Throwable is returned.

Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>

Closes GH-463.
2021-03-23 14:07:21 +01:00
Gabriel Millian
4bf7d10a44 Fix errors in the comments of example number 6
Closes GH-500.
2021-03-22 16:44:17 +01:00
Christoph M. Becker
c4de1a0604 Revert "Show info about PHP error reporting"
This reverts commit f3e5da139a, because
it was accidentally committed.

Cf. <https://github.com/php/doc-en/pull/465>.
2021-03-19 01:54:04 +01:00
Christoph M. Becker
dde64312eb PHP 7.0 was silent about pseudo-numeric string juggling 2021-03-19 01:28:04 +01:00
kestutisv
f3e5da139a Show info about PHP error reporting
Reader needs to be informed about PHP errors.
2021-03-19 01:09:29 +01:00
Eric Stern
661e99fa9d Correct Closure::bindTo failure return value
Closes GH-492.
2021-03-18 21:51:46 +01:00
Sara Golemon
6a89105fdc
Annotate return types for Throwable/Exception/Error as possibly returning null 2021-03-18 14:42:35 +00:00
George Peter Banyard
fc26164b4b
Hot fix for comment of last line 2021-03-11 13:51:06 +00:00
George Peter Banyard
68c0fcdb9e
Add example of a float string as an array key
The behaviour is different from a float key

Also reorder to put this example closer to the numeric keys
Use single quotes consistently

Closes GH-487
2021-03-11 13:49:51 +00:00
Alex Erohin
1075568da5 Fix Ticks usage example
Clarify where tick events are generated, and delete the "equivalent
behavior" example which calls tick_handler() manually, because that
example isn't really suitable.

Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>

Closes GH-464.
2021-03-11 14:18:10 +01:00
Rowan Tommins
ede9d209f6 Clarify the syntax and role of arguments for echo and print
- Rather than implying that parentheses are optional, make clear
  that they are never part of the syntax for these keywords.
- Don't spend so many examples on different types of string.
- Do include examples of non-string arguments.
- Add a note with additional examples of how parentheses interact.
- Don't refer to either construct as "function-like", instead use
  the term "expression" consistently.
- Additional tidying to make the pages more consistent with each
  other.
- Add "print" to the list of language constructs which are
  documented as functions.
- Remove mention of what PHP versions below 5.4 did with short
  echo tags.
2021-03-10 14:37:20 +01:00
Larry Garfield
77a77dbd29 Note that all visibilities of trait abstract methods are supported now
Closes GH-476.
2021-03-10 14:14:18 +01:00
Christoph M. Becker
80958298c0 Fix wording in example
The evaluation order is irrelevant; what matters is the associativity.

This amends commit bcd666c7d0.
2021-03-08 16:19:09 +01:00
Michael Voříšek
bcd666c7d0 Fix ternary precedence
We also fix the misleading note about the ternary operator's
associativity.

Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>

Closes GH-470.
2021-03-08 16:11:18 +01:00
Yoshinari Takaoka
8e7cce7b98 fixed Static resolution operator (::) link, point to paamayim-nekudotayim page. 2021-03-05 23:21:40 +09:00
Yoshinari Takaoka
33e300f8f0 added missing UnhandledMatchError version info. 2021-03-05 22:17:32 +09:00
George Peter Banyard
9ee9eccf45 Refactor OO section part 2
Some misses from the first time

Signed-off-by: Larry Garfield <larry@garfieldtech.com>

Closes GH-329
2021-03-04 17:06:22 -06:00
Christoph M. Becker
3e08a8aae6 Remove obsolete PHP 5 related info from ini.core and related pages 2021-02-24 14:32:08 +01:00
Alex Erohin
529359031b Add final example includes all variations of type casting and overwriting
Closes GH-450.
2021-02-22 17:48:22 +01:00
Christoph M. Becker
3ba291b86a Slightly improve previous commit
Sorry, forgot to do right away.
2021-02-22 17:25:33 +01:00
Alex Erohin
3801e08ff8 Added protected property example for Object To Array conversion
Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>

Closes GH-453.
2021-02-22 17:10:05 +01:00
George Peter Banyard
871df69f47
Explain what consistitutes a more specific type
Closes GH-457
2021-02-18 18:00:47 +00:00
George Peter Banyard
12b1d4704e
Cleanup and update docs related to @ operator
Also fix part of the set_error_handler() docs

Closes GH-441
2021-02-18 16:31:56 +00:00
Christoph M. Becker
4dfe5cc41e Fix #77889: URL in Location header not used 2021-02-17 14:28:06 +01:00
Yoshinari Takaoka
ae956cd678 Named Arguments are also supported. 2021-02-15 23:28:58 +09:00
Sebastian Schendel
46efcedd4a Allow Throwable for $previous param
In current PHP versions the Exception-class seems to allow all Throwable
values for its constructor's $previous param instead of only values of
type Exception.

Closes GH-442.
2021-02-13 15:39:45 +01:00
George B
86951bfac9 Update attributes.xml: Adjustments to grammar
Closes GH-445.
2021-02-13 14:55:49 +01:00
Christoph M. Becker
b3d7fa5000 Add separate section for magic constants
It is pretty confusing to only have a section about "Magic constants"
with the xmlid `language.constants.predefined` but to start that
section with a paragraph about predefined constants.
2021-02-12 14:22:24 +01:00
Rowan Tommins
99b8716337 Remove incorrect note about autoloading in interactive CLI
This was apparently added in response to a bug report against PHP
5.2 [https://bugs.php.net/bug.php?id=40775]. Testing suggests the
limitation was removed at least as long ago as 5.6, and probably
earlier.

Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>

Closes-GH444.
2021-02-11 23:28:27 +01:00
George Peter Banyard
783fbc2001
Add exponentiation assignment operator to corresponding table 2021-02-03 01:46:50 +00:00
Michael Voříšek
fc4e5c27fa Add nullable to return type for Serializable::serialize
Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>

Closes GH-423.
2021-01-28 11:14:29 +01:00
Christoph M. Becker
e55a1ca950 goto labels are case-sensitive
This integrates user note 125733.
2021-01-28 11:10:30 +01:00
Tyson Andre
02f3bf5717 $this is not a **reference** to the called object.
It's the value of the called object.

Additionally, in php 7.1, it was no longer possible to reassign $this
indirectly through a reference.

Even in php 7.0, I'd think it would initially be more like a value
(that references can be created from) than
a reference, but I may be misunderstanding what this means or what $this
did in php 5 or older.

Closes GH-380.
2021-01-24 15:56:27 +01:00
grimskin
572c672502 Small grammar fix for the Attributes docs
- using `is` instead of `are` with singular noun - typo fix in word `separated`

Closes GH-370.
2021-01-22 14:05:08 +01:00
USAMI Kenta
ffbe652535 require_once and include are expressions, not statements
Closes GH-369.
2021-01-20 14:29:11 +01:00