Samuel
53fb200fed
do-while: align example code indentation ( #5278 )
2026-02-06 01:00:26 -08:00
Daniel Scherzer
ba7093cf7f
Fix example code for skipping array elements ( #4851 )
2025-08-28 08:49:10 +08:00
William Entriken
17502ebe06
Prefer comma over || for match conditions ( #4564 )
2025-06-05 18:36:52 +01:00
Juliette
a124543dd3
Fix links to magic constants page ( #4668 )
...
Not sure what happened here, but found quite a few incorrect links for the magic constants page.
Fixed now.
2025-05-15 21:59:00 -07:00
Volker Dusch
53a400680d
Align whitespace for examples on foreach ( #4489 )
...
Ensure each /* Example: */ block is directly on top if the code it's
describing instead of sometimes hovering between code blocks
2025-02-23 14:56:57 +00:00
Volker Dusch
44ae7cb949
Modernize foreach docs ( #4451 )
...
* Use branches and statement_list for pseudocode
* Mention `Traversable` and clarify into wording
* Mention array destructuring in `list()` examples
Implicitly preferring the use of [] by mentioning it first in the examples as this seems to be the more widely used syntax these days
* Deprioritize foreach with references and use short array syntax in examples
* Reword to avoid personalization
2025-02-21 18:58:32 +00:00
Derick Rethans
22583751fb
Fixed syntax errors in more examples
2025-02-07 11:21:39 +00:00
David Fernández
e50047b76f
Match expressions are not required to always be terminated by a semicolon ( #4402 )
2025-01-30 12:46:19 +00:00
Kamil Tekiela
30c0106d51
Update error info for require ( #4362 )
2025-01-14 12:42:59 +00:00
Gina Peter Banyard
6507fc94c2
Fix GH-4023: Fix match example
...
Also fixes user note 129787
2024-11-09 15:00:23 +00:00
Takuya Aramaki
89d80c92a1
include_once is not a statement but an expression (GH-3790)
2024-09-25 14:50:53 +02:00
Mikhail Alferov
5499acf9df
declare.xml: add the missing dot char and amend case of sentences ( #3678 )
...
* declare.xml: add the missing dot char and amend case of sentences
* declare.xml: remove the extra dot character
* declare.xml: use a `simplelist` tag
2024-09-11 14:35:33 +01:00
Marcos Porto Mariño
6c71b05df8
Add new example to match using comparison operators ( #3407 )
2024-05-28 17:38:37 +01:00
Mikhail Alferov
7204e2dbb9
database.xml: add the caption text to the image in the caption tag ( #3266 )
2024-04-12 16:07:28 +01:00
Mikhail Alferov
890a03076b
Update goto.xml
...
combed examples
2024-03-11 16:33:36 +00:00
Mikhail Alferov
1edb3a1bbf
Update goto.xml: add caption-tag to caption-text
...
The label text is merges with the text of the documentation
2024-03-11 16:33:36 +00:00
Kamil Tekiela
28529d3539
Remove unnecessary parentheses
2023-12-11 21:51:20 +01:00
Tim Düsterhus
a41057cbdf
Re-add the semicolon after endswitch in alternative-syntax.xml ( #2699 )
...
This was part of an unrelated commit and is now re-added in a dedicated
single-purpose commit.
see #2648
see #2693
2023-08-21 17:29:27 +02:00
Tim Düsterhus
fb21c51a79
Revert "Fix GH-2635: Fix switch alternative syntax ( #2648 )" ( #2693 )
...
As per the discussion in php/doc-en#2648 , the part that might actually be
unexpected is that leading indentation also causes problems. The addition of
the empty line distracts from that. Now that the CSS for PHP.net is fixed, this
can be reverted.
This reverts commit 1d73d6e34f .
see php/web-php#801
2023-08-21 17:26:21 +02:00
Aleksandr
16389a7b31
Rework the examples for continue ( #2367 )
...
Co-authored-by: Kamil Tekiela <tekiela246@gmail.com >
2023-08-12 18:53:52 +01:00
Alexandre Daubois
1d73d6e34f
Fix GH-2635: Fix switch alternative syntax ( #2648 )
2023-08-07 13:52:50 +01:00
Sidney Lopes
bbaf4fea69
Improve wording around usage of elseif keyword ( #2576 )
...
Co-authored-by: George Peter Banyard <girgias@php.net >
2023-07-13 16:23:21 +01:00
Pierrick Charron
cdc9d28d33
Replace <literal>true/false</literal> by their respective entities ( #2399 )
...
* Replace <literal>true/false</literal> by their respective entities
* Fixes
2023-04-03 17:29:55 -04:00
Pierrick Charron
b809caa29b
Add match entity in language-snippets.ent ( #2374 )
2023-03-21 23:06:10 +00:00
Adrian Siwak
225137059b
Correct print output for more complex switch example
...
Closes GH-1697.
2022-07-15 16:02:49 +02:00
Larry Garfield
bb7242a334
Expand switch description and examples to deprecate comments
...
* Expand switch description and examples to deprecate comments.
* Add see-also from switch to match.
Closes GH-1658.
2022-07-03 20:50:16 +02:00
Christoph M. Becker
0c605d0697
Revert accidentally committed changes
...
I'm really sorry, translators!
This reverts commit f80434b8d1 .
This reverts commit e0c43f6009 .
This reverts commit d5cb2f4965 .
This reverts commit 3a5a6f1970 .
2022-06-29 21:04:46 +02:00
Larry Garfield
f80434b8d1
More examples, to trigger CI.
2022-06-29 17:29:04 +02:00
Larry Garfield
e0c43f6009
Add see-also from switch to match.
2022-06-29 17:29:04 +02:00
Larry Garfield
d5cb2f4965
Improvements from review.
2022-06-29 17:29:03 +02:00
Larry Garfield
3a5a6f1970
Expand switch description and examples to deprecate comments.
2022-06-29 17:28:54 +02:00
Runbing
db7aa4f29b
Clarify phrasing about missing expressing in return statement with return types ( #1652 )
...
The expression about return statement on page "[return](https://www.php.net/manual/en/function.return.php )" is not as clear as that on page "[Migrating from PHP 7.0.x to PHP 7.1.x](https://www.php.net/manual/en/migration71.incompatible.php#migration71.incompatible.typed-returns-compile-time )".
2022-06-24 12:45:48 +01:00
魔王卷子
690c3ea7c7
[skip-revcheck] fixed typo ( #1187 )
2021-12-09 10:12:38 +03:00
Christoph M. Becker
3725fe1c95
Document dangling else handling
...
Cf. <https://bugs.php.net/51016#1619439579 >.
2021-11-16 16:10:56 +01:00
Gert de Pagter
78d273c6d4
Add a very basic match example ( #1028 )
2021-10-19 10:35:03 +01:00
Gabriel Millian
9a72097c8b
[WS] Indent breaks in switch examples ( #882 )
...
Co-authored-by: Sergey Zorin <zors1@php.net >
2021-08-26 21:49:55 +01:00
Yoshinari Takaoka
17297101a4
updated strict_typing link.
2021-08-21 10:15:21 +09:00
zors1
ea8796a6c3
Fix case of a keyword in match.xml ( #736 )
2021-06-26 17:42:36 +01:00
Yoshinari Takaoka
dcbd255b07
fixed match expression example comment.
2021-06-05 04:30:28 +09:00
Christoph M. Becker
e49940b757
Fix #73938 : PHP7 foreach internal array pointer
2021-03-31 16:09:52 +02: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
Christoph M. Becker
e55a1ca950
goto labels are case-sensitive
...
This integrates user note 125733.
2021-01-28 11:10:30 +01:00
USAMI Kenta
ffbe652535
require_once and include are expressions, not statements
...
Closes GH-369.
2021-01-20 14:29:11 +01:00
Nilgün Belma Bugüner
d60cfe1bfd
chmod -x
2021-01-06 15:22:17 +03:00
Kamil Tekiela
4774ba9dba
Incorrect value in include. Patch provided by anonymous 992 via edit.php.net
...
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@352283 c90b9560-bf6c-de11-be94-00142212c4b1
2020-12-29 17:55:33 +00:00
Christoph Michael Becker
7104ee97ce
Removed literal tags from title for readability
...
Closes GH-250.
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@351935 c90b9560-bf6c-de11-be94-00142212c4b1
2020-12-06 22:38:36 +00:00
Christoph Michael Becker
58dc296fc5
Fix example in match docs (missing terminating semi-colon)
...
As pointed out by girgias.
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@351833 c90b9560-bf6c-de11-be94-00142212c4b1
2020-12-02 00:18:01 +00:00
George Peter Banyard
6970f8fa7b
Add match expression documentation
...
This includes:
- match expression page
- UnhandledMatchError page
Co-authored-by: Larry Garfield <larry@garfieldtech.com >
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@351499 c90b9560-bf6c-de11-be94-00142212c4b1
2020-11-22 17:31:20 +00:00
George Peter Banyard
31379d5d4a
Add PHP 8 to versions.xml in language section
...
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@351498 c90b9560-bf6c-de11-be94-00142212c4b1
2020-11-22 17:06:29 +00:00
George Peter Banyard
a9a6224ca9
Split type declarations into their dedicated page
...
Remove obsolete OOP5 TypeHinting page
Document union types
Closes GH-174
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@351365 c90b9560-bf6c-de11-be94-00142212c4b1
2020-11-12 18:39:19 +00:00