Commit graph

191 commits

Author SHA1 Message Date
Sergey Panteleev
b7c12f23bd
Fix preg_match_all return values (#1122)
Closes #1102
2021-11-18 12:48:37 +03:00
Juliette
41c8533ff5
PCRE: add missing "Errors/Exceptions" section
All PCRE pattern matching functions will throw a warning when an invalid regex is passed to the `$pattern` parameter.
See: https://3v4l.org/WkVIW

This was thus far undocumented behaviour.

This PR adds:
* The "Errors/Exceptions" section to each of the PCRE pattern matching function documentation pages (if it didn't exist yet).
* Adds a macro for the text snippet about the warning to display in the section and uses that in the "Errors/Exceptions" section for each function.

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>

Closes GH-1057.
2021-11-08 13:01:56 +01:00
Kamil Tekiela
40ef830808
Align return values for pcre_* functions (#857) 2021-08-18 16:34:37 +01:00
Christoph M. Becker
f33541d156
Fix #856: preg_grep returns false on failure 2021-08-17 23:21:45 +02:00
George Peter Banyard
3c68e46cea Fix section order issues in PCRE extension
preg_filter() parameters still need to be documented.

Part of #658
2021-06-06 18:03:03 +01:00
Sergey Panteleev
8a058e9acd
Removed references to PHP 5, 7.0 (#549)
PDO and PCRE sections
2021-04-27 12:53:38 +03:00
Sergey Panteleev
aab33d6443
Removed references to PHP 5, PHP 7.0 (#544) 2021-04-23 11:35:26 +03:00
Máté Kocsis
a411286750 Generate methodsynopses based on recently updated stubs
Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>

Closes GH-362.
2021-01-18 23:31:36 +01:00
Christoph Michael Becker
4754397753 Revert revision 351727 from phpdoc/en/trunk:
Document false and null return types

Cf. <https://news-web.php.net/php.doc.cvs/17645>.


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@351729 c90b9560-bf6c-de11-be94-00142212c4b1
2020-11-28 17:58:32 +00:00
Jakub Vrana
69bd53265b Document false and null return types
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@351727 c90b9560-bf6c-de11-be94-00142212c4b1
2020-11-28 15:12:46 +00:00
Christoph Michael Becker
22e850b66c Generate pcre methodsynopses based on stubs
Based on a patch contributed by Máté Kocsis <kocsismate@woohoolabs.com>.


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@351490 c90b9560-bf6c-de11-be94-00142212c4b1
2020-11-22 12:38:46 +00:00
Christoph Michael Becker
b95d28e6ec Fix return types
Functions which return false on failure should state that in their
signature as well.


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@351135 c90b9560-bf6c-de11-be94-00142212c4b1
2020-11-02 15:52:35 +00:00
Christoph Michael Becker
3ec7b61315 Add preg_last_error_msg documentation
Patch contributed by Nicolas Oelgart <nicolas.oelgart@atrapalo.com>.


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@350809 c90b9560-bf6c-de11-be94-00142212c4b1
2020-10-07 17:24:21 +00:00
Christoph Michael Becker
80872147aa Get rid of "callback" types
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@350788 c90b9560-bf6c-de11-be94-00142212c4b1
2020-10-06 09:11:05 +00:00
Christoph Michael Becker
7d4c08228e Fix #80166: preg_match_all()'s PREG_OFFSET_CAPTURE ignoring modifier u
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@350739 c90b9560-bf6c-de11-be94-00142212c4b1
2020-10-01 12:19:02 +00:00
Christoph Michael Becker
7f569e1f17 Remove more changelog entries, mostly from PHP 5.3 era
Patch contributed by Sobak <msobaczewski@gmail.com>.


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@350655 c90b9560-bf6c-de11-be94-00142212c4b1
2020-09-26 14:08:59 +00:00
Christoph Michael Becker
9af43469f4 Remove more changelog entries, mostly from PHP 5.2 era
Patch contributed by Sobak <msobaczewski@gmail.com>.


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@350654 c90b9560-bf6c-de11-be94-00142212c4b1
2020-09-26 13:52:31 +00:00
Christoph Michael Becker
53bdffa6b9 Removed some of the PHP5 changelogs
Patch contributed by Sobak <msobaczewski@gmail.com>.


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@350645 c90b9560-bf6c-de11-be94-00142212c4b1
2020-09-26 12:32:19 +00:00
Christoph Michael Becker
5d3f4f8b94 PHP 7.4: PCRE: document new $flags param for preg_replace_callback[_array]()
The PHP 7.4 `$flags` parameter as added to the `preg_replace_callback()` and `preg_replace_callback_array()` function was not yet included in the documentation.

In this PR, I'm
* Adding the parameter to the function signature.
* Adding minimal parameter documentation with a reference to the more detailed explanation in the parameter documentation of the [`preg_match()`](https://www.php.net/manual/en/function.preg-match.php) function.
* Adding a changelog entry for the parameter to each function.

Refs:
* https://github.com/php/php-src/pull/3958
* 2f1398dad9/UPGRADING (L304-L308)

Patch contributed by jrfnl.


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@349965 c90b9560-bf6c-de11-be94-00142212c4b1
2020-05-23 15:01:09 +00:00
Christoph Michael Becker
b7ca52647b Fix #79594: Uncaught TypeError: preg_split() expects parameter 3 to be int, null given
Nope, passing `null` doesn't necessarily mean "skip this argument".

This also integrated user note 121475.


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@349857 c90b9560-bf6c-de11-be94-00142212c4b1
2020-05-13 15:20:59 +00:00
Christoph Michael Becker
09483f34bc Fix #78168: Reference Format is \n instead of \\n
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@349366 c90b9560-bf6c-de11-be94-00142212c4b1
2020-03-10 09:11:07 +00:00
Christoph Michael Becker
82cff784b0 Merged revision(s) 347600 from phpdoc/en/trunk:
Fix #78163: preg_quote() documented as accepting null for $delimiter, which actually throws
........
Cf. <https://bugs.php.net/bug.php?id=78163#1560771170>.

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@347611 c90b9560-bf6c-de11-be94-00142212c4b1
2019-06-17 12:35:42 +00:00
Christoph Michael Becker
568cd69529 Fix #78163: preg_quote() documented as accepting null for $delimiter, which actually throws
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@347600 c90b9560-bf6c-de11-be94-00142212c4b1
2019-06-14 16:11:17 +00:00
Christoph Michael Becker
d31d783a65 Fix #77848: Documentation on the /e removal is misleading
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@347268 c90b9560-bf6c-de11-be94-00142212c4b1
2019-04-17 14:21:49 +00:00
Christoph Michael Becker
f49e92f06f Add hash to list of special regular expression characters
Patch provided by Huiren Woo.

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@346423 c90b9560-bf6c-de11-be94-00142212c4b1
2018-12-26 14:20:39 +00:00
Christoph Michael Becker
48bac4e0ab Integrate user note 118893
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@345922 c90b9560-bf6c-de11-be94-00142212c4b1
2018-10-28 10:45:30 +00:00
Pasindu De Silva
7e18f0a154 Added change log about preg_quote() escaping the '#' character.
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@345761 c90b9560-bf6c-de11-be94-00142212c4b1
2018-10-01 17:33:37 +00:00
Christoph Michael Becker
f73a9831d2 With declare(strict_types = 1) null is not an allowed value for the limit parameter.
-- 
Provided by anonymous 89383 ()

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@344928 c90b9560-bf6c-de11-be94-00142212c4b1
2018-05-02 22:19:23 +00:00
Christoph Michael Becker
6e796ded26 Fix substr() related markup
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@344771 c90b9560-bf6c-de11-be94-00142212c4b1
2018-04-20 16:32:15 +00:00
Christoph Michael Becker
84729f2123 Document PREG_UNMATCHED_AS_NULL
Sans the behavior of trailing unmatched subpatterns,
see https://bugs.php.net/73948.

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@344668 c90b9560-bf6c-de11-be94-00142212c4b1
2018-04-14 15:40:43 +00:00
Christoph Michael Becker
90251a0f83 Fix grammar
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@342565 c90b9560-bf6c-de11-be94-00142212c4b1
2017-06-08 09:47:05 +00:00
Christoph Michael Becker
952a9acd72 Add note on avoiding substr() with $offset
-- 
Provided by anonymous 61891 (rasmus@mindplay.dk)

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@342563 c90b9560-bf6c-de11-be94-00142212c4b1
2017-06-08 09:30:36 +00:00
Christoph Michael Becker
f6b3cb3437 Fix #73709: preg_match_all PREG_OFFSET_CAPTURE documentation incorrect
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@341360 c90b9560-bf6c-de11-be94-00142212c4b1
2016-12-10 16:29:17 +00:00
Maciej Sobaczewski
95bdd6883b Another round of PHP 4 content removal (mostly inline mentions)
Review is welcome

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@341282 c90b9560-bf6c-de11-be94-00142212c4b1
2016-12-05 10:17:07 +00:00
Christoph Michael Becker
c01961f079 Fix typos
Patch provided by anon users.

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@341136 c90b9560-bf6c-de11-be94-00142212c4b1
2016-11-25 12:22:13 +00:00
Christoph Michael Becker
441f9436b4 Fix #66664: preg_match_all + PREG_PATTERN_ORDER + PCRE_INFO_JCHANGED, output wrong result
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@340012 c90b9560-bf6c-de11-be94-00142212c4b1
2016-09-10 00:25:03 +00:00
Christoph Michael Becker
8adbf24fe9 Document failure return value
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@339933 c90b9560-bf6c-de11-be94-00142212c4b1
2016-08-23 13:34:21 +00:00
Christoph Michael Becker
b64ba59d6a Fix #64516: preg_quote() doesn't work to escape the replacement
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@339916 c90b9560-bf6c-de11-be94-00142212c4b1
2016-08-20 13:02:09 +00:00
Christoph Michael Becker
4e713319a0 Add missing markup
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@339915 c90b9560-bf6c-de11-be94-00142212c4b1
2016-08-20 12:57:20 +00:00
Christoph Michael Becker
20ccb21520 Integrate user note 115687
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@339914 c90b9560-bf6c-de11-be94-00142212c4b1
2016-08-20 12:49:18 +00:00
Christoph Michael Becker
91b8b05f52 fix #72341: Inconsitent $ escaping in preg_replace replacement patterns
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@339301 c90b9560-bf6c-de11-be94-00142212c4b1
2016-06-06 16:54:44 +00:00
Christoph Michael Becker
d62d6b01c4 minor fixes by anon users
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@338862 c90b9560-bf6c-de11-be94-00142212c4b1
2016-03-31 18:48:08 +00:00
Adam Harvey
72af2380f5 Cut down the preg_replace_callback_array() part of the migration guide.
I've removed the example: it was terrific, but the function reference has a
good example, and it was much too long for the page.

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@337869 c90b9560-bf6c-de11-be94-00142212c4b1
2015-09-21 12:17:02 +00:00
Simion Onea
7050d96265 Corrected/added SVN properties, especially svn:keywords.
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@337516 c90b9560-bf6c-de11-be94-00142212c4b1
2015-08-17 15:27:48 +00:00
Christoph Michael Becker
e9be1b6379 The page for strstr() recommends using strpos(). preg_match() should match this recommendation.
-- 
Provided by anonymous 62208 (Liam Morland)

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@337467 c90b9560-bf6c-de11-be94-00142212c4b1
2015-08-15 01:16:19 +00:00
Thomas Punt
03393b1f43 Added preg_replace_callback_array function
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@337413 c90b9560-bf6c-de11-be94-00142212c4b1
2015-08-12 15:39:47 +00:00
Christoph Michael Becker
84a87a7fa9 documented PREG_JIT_STACKLIMIT_ERROR
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@337283 c90b9560-bf6c-de11-be94-00142212c4b1
2015-08-04 02:14:47 +00:00
Maciej Sobaczewski
86727eb89e Document PREG_REPLACE_EVAL removal
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@336806 c90b9560-bf6c-de11-be94-00142212c4b1
2015-05-20 05:15:44 +00:00
Dan Ackroyd
cc6711c55b Corrected order. The example is showing that the order is unexpected, and that you need to sort to get the 'right' order.
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@335841 c90b9560-bf6c-de11-be94-00142212c4b1
2015-01-29 19:33:59 +00:00
Daniel Convissor
f08a981a30 Add preg_quote() to See Also
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@335337 c90b9560-bf6c-de11-be94-00142212c4b1
2014-12-22 16:03:21 +00:00