1
0
mirror of https://github.com/php/doc-en.git synced 2026-04-25 16:28:09 +02:00
Commit Graph

979 Commits

Author SHA1 Message Date
Louis-Arnaud ec01a42be5 Document setlocale() incompatibility with integer 0 in PHP 8.5 (#5094) 2026-01-30 10:08:26 +00:00
Anton L. 49999607f4 docs(printf): fix incorrect cutoff value in examples (#5080) 2026-01-11 20:28:47 +00:00
Mikhail Alferov 95d0554643 mb-strpos.xml Use parameter names instead of types, fix typos and XML syntax (#4964) 2025-10-31 15:33:32 +00:00
Kevin Boyd 4b72b23513 Update strpos docs with error handling details when offset exceeds length (#4959)
* Update strpos.xml with error handling details

Added error handling information for offset parameter, after observing this un/underdocumented fatal in production.

Note: Using the github web editor, I am not sure if I can pull a second file into this PR, so I may submit a second PR to handle `stripos`.

* Document error for offset exceeding haystack length

Added error handling information for offset parameter.

* Document error for exceeding offset length

Added error handling information for offset parameter.

* Document error for offset exceeding haystack length

Added error handling information for offset parameter.

* Apply suggestions from code review

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

* Apply review suggestions

* Remove csprng-specific html entity

* Add invalid offset ValueError information to strrpos-related methods

* Fix whitespace for strprpos error message info

---------

Co-authored-by: Tim Düsterhus <tim@bastelstu.be>
2025-10-28 23:22:11 +01:00
Mikhail Alferov 71166b721b substr.xml Remove the redundant mention of the offset (#4759)
The function first determines the starting position of the substring (part of the original string), and then drops abs($length) characters from the tail of this substring if the value of the $length parameter is negative. I don't understand the meaning of the parenthesized notation, and it seems redundant to me; as if the $length parameter behaves differently with a positive offset. My point is that with a negative value of the $offset parameter, the behavior of the $length parameter does not change, so why mention the negative offset separately. Moreover, the end of the original string and the end of the substring that remained after applying the offset are the same ends, no matter how you look at it, and it is from these ends that the function will discard characters.
2025-10-15 15:39:18 +01:00
AllenJB 873f4a3d50 String comparison / similarity doc improvements (#4647)
* strcmp: Improve behavior description and direct users to alternative functions (strcoll and Collator::compare) where appropriate;
Add the "similarity" functions to seealso
Removed substr from seealso (why is it here?)

* Cross-link all the string similarity functions

* Trailing whitespace removal

* Update reference/strings/functions/strcmp.xml

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

* strcmp: Improve behavior description and direct users to alternative functions (strcoll and Collator::compare) where appropriate

---------

Co-authored-by: Kamil Tekiela <tekiela246@gmail.com>
2025-10-03 09:47:29 -05:00
Mikhail Alferov 004fb3136a stripos.xml Make the comment consistent (#4757) 2025-10-02 16:04:49 -05:00
Remi Collet 09324fb1df better doc for setlocale (#4770) 2025-07-11 10:58:55 +02:00
Remi Collet 9ff8b114b8 document setlocale(LC_ALL, null) to retrieve current setting (#4765) 2025-07-11 06:43:29 +02:00
Rowan Tommins da15b6674a Modernise parse_str description (#4556)
Most of the text still acted as though "create a bunch of local variables" was the normal behaviour, even though it's been discouraged for years, and isn't even supported in PHP 8.

There were also a few incorrect or questionable uses of markup.
2025-05-06 21:40:12 +01:00
Derick Rethans 45042fef65 Enable WASM for book.strings, and tweak examples 2025-05-06 12:06:07 +01:00
philip 5d7f95f58f Document max_input_vars impact on parse_str() (fixes #4521) 2025-03-18 08:24:30 -07:00
Gina Peter Banyard f112cc1ec6 Fix some markup issues from 06313c3bb1
Also some few drive-by fixes of versions.xml
2025-03-06 13:38:24 +00:00
philip 06313c3bb1 Added or updated the changelog section for functions containing this entity:
warn.deprecated.function-7-4-0.removed-8-0-0
2025-02-28 10:18:24 -08:00
Jim Winstead 9b68bf2b63 Clarify return value of strcmp() and friends (fixes #3629) (#4295) 2024-12-16 22:55:24 +01:00
Jim Winstead ae148826a6 Document number_format() handling of negative $decimals (closes #4200) (#4201)
Co-authored-by: Gina Peter Banyard <girgias@php.net>
2024-12-01 11:38:35 -08:00
Jim Winstead 781f2ec04e Document str_getcsv() and fgetcsv() change in 8.3.0 (closes #4197) (#4198) 2024-12-01 12:20:46 +00:00
Máté Kocsis 9b1673cf11 Mark deprecated functions with the #[\Deprecated] attribute (#4161) 2024-11-27 20:38:45 +01:00
Gina Peter Banyard 73007ad988 PHP 8.4: CSV related changes and deprecations (#4093)
Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
2024-11-19 23:11:44 +00:00
Tim Düsterhus 07ab08b4a2 Use full version for utf8_(de|en)code deprecation (#4011) 2024-11-05 22:58:35 +01:00
Jonathan Goode eb3c7d0d67 Fix Grammar (GH-3982) 2024-10-31 22:24:22 +01:00
tekimen 31e3015907 [PHP 8.4] Add manual for grapheme_str_split function (GH-3956)
Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
2024-10-30 15:53:18 +01:00
Gina Peter Banyard 2a5223230b Use informal variant of tag instead of empty title tag (#3928) 2024-10-28 16:04:31 +00:00
David Fernández 06394ea77c Fix GH-2405 Example no longer valid as of php 8.1 (#3948) 2024-10-28 16:01:06 +00:00
Sergey Panteleev 27ae0a4a16 [PHP 8.4] Add mb_* functions (#3922)
Co-authored-by: Gina Peter Banyard <girgias@php.net>
Co-authored-by: tekimen <youkidearitai@gmail.com>
2024-10-24 23:33:20 +03:00
Wouter de Jong 89990d6588 Clarify strcspn() example (#3892)
Using human readable words for the `$characters` parameter creates
confusion, as each character is used separately in the function.
2024-10-23 13:48:39 +02:00
Niels Dossche ae79488085 Add PHP 8.4 changelog entry for strcspn() (#3888)
* Add PHP 8.4 changelog entry for strcspn()

* Update reference/strings/functions/strcspn.xml

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

---------

Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
2024-10-20 23:05:59 +02:00
Mikhail Alferov a6ee935b0e wordwrap() Add errors/changelog sections, specify U+0020 instead U+20 (#3817)
---------

Co-authored-by: Gina Peter Banyard <girgias@php.net>
2024-10-03 13:06:32 +01:00
Daniel Aleksandersen 2ed0a46d44 Document where wordwrap() wraps (#1524)
* Document when wordwrap() wraps

---------

Co-authored-by: Jim Winstead <jimw@trainedmonkey.com>
2024-09-29 12:54:07 +01:00
Jim Winstead cef78b0fbe Add explicit warning about CSV function's escape parameter (#3765) 2024-09-23 13:59:30 -07:00
Chris Brown 43cc4ed372 strncmp: Correct minor typo in example (#3768)
`are equals` vs `are equal`
2024-09-21 15:31:50 -07:00
Mikhail Alferov 523a0692f7 book.xml: add a link to the PCRE section (#3590) 2024-07-26 02:52:45 +01:00
haszi 48ce43fe79 Remove empty resources pages (#3545)
Co-authored-by: haszi <haszika80@gmail.com>
2024-07-26 02:17:29 +01:00
Mikhail Alferov 7efec4c29a strpos.xml: add the parameter tag to the offset (#3553)
* strpos.xml: add the `parameter` tag to the offset
* strpos.xml: mark numbers as `literal`
2024-07-11 23:45:11 +02:00
haszi 765b2d6eec Remove empty configuration pages (#3538)
Co-authored-by: haszi <haszika80@gmail.com>
2024-07-09 22:24:55 +01:00
Mikhail Alferov 3d38c9a1ce trim.xml: additionally describe the characters parameter (#3500)
* trim.xml: additionally describe the characters `parameter`

```<?php

$string = "foo123bar";

var_dump(
    trim($string, "a..z"), // 123
    trim($string, "a..Z"), // Warning: trim(): Invalid '..'-range, '..'-range needs to be incrementing
);```

* Update trim.xml: remove personalization
2024-07-09 19:40:36 +01:00
haszi 5cadfd39ba Add ALT_DIGITS constant (#3473)
Co-authored-by: haszi <haszika80@gmail.com>
2024-07-07 14:51:16 +01:00
Tim Düsterhus 71e12e2df7 Clean up “See Also” for hash*() (#3482)
* Clean up “See Also” for `hash*()`

Specifically remove the `md5*()` and `sha1*()` references, but also shorten the
lists in general: All hash functions are somewhat related, that does not mean
that each should reference each other.

see https://wiki.php.net/rfc/deprecations_php_8_4#deprecate_md5_sha1_md5_file_and_sha1_file
see php/doc-en#2822

* Clean out “See Also” of `md5*()` and `sha1*()`
2024-07-07 14:47:57 +01:00
haszi 605553e228 Remove empty requirements pages (#3464)
Co-authored-by: haszi <haszika80@gmail.com>
2024-07-07 14:34:34 +01:00
haszi bdef726773 Add replaceable tag to the appropriate nl_langinfo constants (#3442)
Co-authored-by: haszi <haszika80@gmail.com>
2024-06-14 16:06:05 +01:00
haszi 50ac73a352 Add individual ABDAY, DAY, ABMON and MON constants (#3440)
Co-authored-by: haszi <haszika80@gmail.com>
2024-06-14 16:05:26 +01:00
haszi 0d39e1f71e Add locale constant descriptions (#3441)
Co-authored-by: haszi <haszika80@gmail.com>
2024-06-14 16:05:01 +01:00
haszi ccafc8c3c3 [skip-revcheck] Copy constants from nl_langinfo to constants page (#3299)
Co-authored-by: haszi <haszika80@gmail.com>
2024-05-27 13:30:51 +01:00
Máté Kocsis d76a7fe17d Document SensitiveParameter attributes - part 2 (#3403) 2024-05-21 12:11:42 +01:00
Gina Peter Banyard 62126c55f1 Minor markup issue fixups 2024-04-22 13:25:39 +01:00
haszi 61374bbe22 Change literal to constant tags 2024-04-16 10:45:49 +01:00
Pierre Ambroise c276fff86c Update strstr note (#3235)
Drive-by personalization removal

Co-authored-by: Gina Peter Banyard <girgias@php.net>
2024-03-05 22:36:57 +00:00
Sergey Panteleev 443d81b33e [PHP 8.3] Update functions (#3106)
Co-authored-by: Gina Peter Banyard <girgias@php.net>
2024-01-16 16:36:49 +03:00
Gina Peter Banyard d369659c3f Add missing stristr 8.0 changelog 2023-11-18 04:48:44 +00:00
Jawira Portugal 1f0319dfed add link to multibyte version of str_pad (#2908) 2023-11-04 18:57:01 +09:00