1
0
mirror of https://github.com/php/doc-en.git synced 2026-03-23 23:32:18 +01:00

537 Commits

Author SHA1 Message Date
Kamil Tekiela
3f1dbc451b Remove <para> in invalid places (#4999) 2025-11-15 02:02:26 +00:00
Martin Samesch
2916fa4160 Fix typo in assert.xml (#4691) 2025-06-05 17:55:32 +01:00
Tim Düsterhus
ebb70366b0 assert: Add assert.active=0 to the “always true” return values (#4663) 2025-05-20 22:47:07 +01:00
pvandommelen
bb9365a577 Change line mentioning assert should only be used when debugging (#4537)
The implication of only being used as a debugging tool is that it should never hit production code.
This is contradicted by the line above ("but are optimised away to have zero cost in production") above and the paragraph following it which requires asserts to exist in running code to make sense.

As mentioned in a comment on the php.net page (https://www.php.net/manual/en/function.assert.php#129271), `assert` sees widespread usage in code in the wild. It definitely is used outside of debugging.

Instead of removing it, this changes the line to mention its relation to debugging which is relevant and otherwise absent from the article.
2025-03-23 16:59:40 +01:00
Gina Peter Banyard
a277389c9d Remove changelog section for getrusage()
This mentionned only changes prior to PHP 7.0.0
2025-03-06 15:16:37 +00: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
Arnaud Le Blanc
b1116af466 Document zend.max_allowed_stack_size and related parameters 2025-01-27 14:18:37 +00:00
Volker Dusch
4c016ab334 ini_get: Update example to use ini_parse_quantity() (#4372)
Resolves php/doc-en#4185
2025-01-14 13:23:07 +00:00
Jim Winstead
03db4883c5 php_uname() now throws ValueError (#3969)
* `php_uname()` now throws `ValueError`

* Be even more explicit about what 'a' means
2024-11-20 01:41:15 +00:00
Mikhail Alferov
3050928258 Modernize phpversion() documentation (#3608) 2024-11-09 14:44:37 +00:00
Mikhail Alferov
9fd978fa05 constants.xml: a couple of fixes (GH-3685)
Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
2024-09-02 17:08:44 +02:00
haszi
d5d10b38b4 Add links to INI_* constants (#3476)
* Add links to INI_* constants

Replace XInclude'd variablelist with a duplicate which does not have any IDs for the constants.
Add IDs to the variablelist on the constant page.

* Add comment with xi:include

---------

Co-authored-by: haszi <haszika80@gmail.com>
2024-08-25 22:08:22 +01:00
Mikhail Alferov
c8a8981a9d ini-get[-all].xml: add the literal tag to the pdo.dsn.* family of options and amend the code example (#3580)
* ini-get.xml: add the literal tag to the pdo.dsn.* family of options

* ini-get-all.xml: add the literal tag

* ini-get.xml: modify the code example and the output

* Update ini-get.xml: fix the size in bytes

* ini-get.xml: fix converting k, m, g into bytes

We could use merely this insted the `return_bytes` fn:

```
<?php

/*
Our php.ini contains the following settings:

display_errors = On
register_globals = Off
post_max_size = 8M
*/

echo 'display_errors = ' . ini_get('display_errors') . "\n";
echo 'register_globals = ' . (int) ini_get('register_globals') . "\n";
echo 'post_max_size = ' . ini_get('post_max_size') . "\n";
echo 'post_max_size + 1 = ' . (rtrim(ini_get('post_max_size'), 'KMG') + 1) . "\n";
echo 'post_max_size in bytes = ' . ini_parse_quantity(ini_get('post_max_size'));
```
2024-07-26 02:36:33 +01:00
haszi
48ce43fe79 Remove empty resources pages (#3545)
Co-authored-by: haszi <haszika80@gmail.com>
2024-07-26 02:17:29 +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
57d1b0df36 Remove empty installation pages (#3462)
Co-authored-by: haszi <haszika80@gmail.com>
2024-06-21 02:38:44 +01:00
haszi
d228d0aa06 [skip-revcheck] Convert info constant tables to variablelists (#3342)
Convert XIncluded table to variablelist

Co-authored-by: haszi <haszika80@gmail.com>
2024-05-10 14:42:08 +01:00
Gina Peter Banyard
27dcb487a7 Make assert() Changelog section DocBook 5.2 conformant (#3343) 2024-04-24 23:19:51 +01:00
haszi
87663748fb Add id for INI mode table and remove row ids 2024-01-28 18:16:27 +00:00
Gina Peter Banyard
d4d5216e7a [skip-revcheck] Replace PHP_INI_* with INI_* constants
Performed via a bash script which can be found on PR GH-3140

Closes GH-3140

Co-authored-by: haszi <haszika80@gmail.com>
2024-01-26 14:00:36 +00:00
haszi
05c845a6de Remove PHP 5.3 related note 2024-01-25 13:32:06 +00:00
haszi
7280983eb4 Remove PHP_INI_ aliases 2024-01-25 13:32:06 +00:00
haszi
630ed2ee1d Add INI mode constant descriptions 2024-01-25 13:32:06 +00:00
haszi
d9d79e4bf9 [skip-revcheck] Fix whitespace 2024-01-25 13:32:06 +00:00
Sergey Panteleev
29e86aa417 [PHP 8.3] Update gc_status function (#3096)
Co-authored-by: Gina Peter Banyard <girgias@php.net>
2024-01-11 00:36:02 +03:00
Gina Peter Banyard
2df224f445 Drop see also member to remove PECL function 2023-11-02 17:28:37 +00:00
Tim Düsterhus
b2cbcaea5b assert: Remove “not recommended” reference to assert_options() (#2869)
The reference itself says that this is not recommended and `assert_options()`
itself is deprecated in PHP 8.3. Remove the reference to slim down the docs.
2023-10-20 12:24:24 +01:00
Tim Düsterhus
968e209abc assert: Remove note about it being a language construct (#2877)
`assert()` behaves like a regular function for all intents and purposes. It can
even be used as a string callable. The only special thing about is that the
`$description`'s default parameter is dynamic.
2023-10-20 12:22:17 +01:00
Tim Düsterhus
30aac0c739 assert: Rewrite examples (#2861)
- Drop the assert.exception=0 case, because that is deprecated.
- Showcase the output for enabled assertions first.
- Add example with a custom message
2023-10-17 00:22:23 +01:00
Tim Düsterhus
56e917c669 assert: Fix return value explanation (#2863)
Specifically, `assert()` will always return `true` if assertions are disabled.
Ideally, the return value would never be used anyway …
2023-10-17 00:22:03 +01:00
Tim Düsterhus
fff186098a assert: Drop examples for legacy string-based assertions (#2862)
They are no longer supported as of PHP 8 and only serve to cause confusion for a
feature that is already complex enough by itself.

In fact the examples will silently misbehave in PHP 8, because a non-empty
string is truthy and no warning is emitted.
2023-10-17 00:19:26 +01:00
George Peter Banyard
ada1d79de3 PHP 8.3: legacy assertion have been deprecated (#2840) 2023-10-08 17:57:35 +01:00
George Peter Banyard
dbdea7f23e Fix GH-2621: Default value of assert.exception is still "0"
It was changed to 1 in PHP 8.0.0.
2023-07-29 06:08:37 +01:00
Alexandre Daubois
4fd318ca79 Add a note about PHP core extension versions in phpversion() (#2613) 2023-07-28 16:25:54 +01:00
Marcel Gleis
e947f2e12b Update getrusage() docs: added ru_stime.tv_sec to the example (#2579)
Added ru_stime.tv_sec to the example.


echo $dat["ru_stime.tv_sec"];  // system time used (seconds)
2023-07-17 15:44:14 +01:00
George Peter Banyard
62aa2694ba Improve Info INI page (#2543)
Remove outdated information about magic quotes
Warn that assert.quiet-eval was removed and to use zend.assertions
2023-06-27 13:26:05 +01:00
George Peter Banyard
bfabdf420f [skip-revcheck] Minor whitespace fixes 2023-06-13 13:28:40 +01:00
Yoshinari Takaoka
588a44da90 changed assertion in return value description as parameter. 2023-06-10 11:11:57 +09:00
Máté Kocsis
1299a98087 Update the documentation of getenv (#2481)
Co-authored-by: George Peter Banyard <girgias@php.net>
2023-06-08 20:50:58 +02:00
George Peter Banyard
389525942d Update assert() docs for PHP 8 (#2467)
Co-authored-by: Larry Garfield <larry@garfieldtech.com>
2023-06-05 14:38:21 +01:00
Máté Kocsis
f781803449 Narrow bool return types to true when possible (#2458) 2023-05-07 22:32:58 +02:00
Ben Harris
701b63e2cc [skip-revcheck] fix typo in ini-parse-quantity.xml (#2437) 2023-04-23 13:36:28 +02:00
Alex Dowad
e2e41fdb46 Clarify handling of 3rd parameter for assert callbacks
The handling of the 3rd parameter for assert callbacks set via `assert_options`
changed with the implementation of the expectations RFC, and changed again in
PHP 8. Update the documentation accordingly.

This one seems to be a cause for confusion; witness Bug [#79602]
(https://bugs.php.net/bug.php?id=79602).

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

Closes GH-120.
2023-01-04 17:57:44 +01:00
Florian Engelhardt
87955a630a Add docs for ini_parse_quantity function (#1810)
Co-authored-by: Florian Engelhardt <florian.engelhardt@r-nw.de>
Co-authored-by: George Peter Banyard <girgias@php.net>
Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
2022-12-05 17:11:59 +00:00
Christoph M. Becker
a89c6d71c7 ZTS builds are no longer experimental 2022-11-14 15:01:29 +01:00
Florian Engelhardt
57015edfe2 Add docs for memory_reset_peak_usage() (#1809)
Co-authored-by: Florian Engelhardt <florian.engelhardt@r-nw.de>
2022-09-26 10:49:02 +01:00
Christoph M. Becker
928e363675 Clarify availability of dl()
We deliberately ignore potential custom SAPIs.

This integrates user note 116174.
2022-09-14 14:02:26 +02:00
Michael Voříšek
ec0e479536 Update get_loaded_extensions() output example
To  stress the names are not in LC and Core is present.

Closes GH-1819.
2022-09-12 14:50:11 +02:00
USAMI Kenta
0e8fa6aa16 Add reference to get_defined_constants() and constant() each other (#1642)
* Add reference to get_defined_constants()

* Add reference to constant()
2022-06-23 18:22:04 +09:00