Missing Function: `fpm_get_status`
Function URL
https://www.php.net/manual/en/function.fpm-get-status.php
PHP Version
8.1
Safe Version
3.2.0
Extra Info
fpm_get_status() wrapper is missing on PHP 8.1. Since its first implementation, it may return false on error (see https://github.com/php/php-src/commit/140def4ac712acac6e2561f65e1b72f8efad8717), but the documentation introduces this return value only on PHP 8.2 (see https://github.com/php/doc-en/commit/5764345c8662c22b570bf453650a9dd584bd3abb).
I thought the following patch may permit to detect it on PHP 8.1, but it does not. I must miss something.
diff --git a/generator/config/detectErrorType.php b/generator/config/detectErrorType.php
index 988bb20..1b18ea2 100644
--- a/generator/config/detectErrorType.php
+++ b/generator/config/detectErrorType.php
@@ -55,6 +55,7 @@ return function (string $text): ErrorType {
'/This function returns &true; if a session was successfully started,\s+otherwise &false;./m', // session_start
'/&false;\s+if\s+the\s+timestamp\s+doesn\'t\s+fit\s+in\s+a\s+PHP\s+integer./m', // gmmktime / mktime
'/<function>mktime<\/function>\s+returns\s+the\s+Unix\s+timestamp\s+of\s+the\s+arguments\s+given./', // mktime before https://github.com/php/doc-en/pull/2651
+ '/Associative\s+array\s+containing\s+the\s+full\s+FPM\s+pool\s+status/', // fpm_get_status
];
foreach ($falsies as $falsie) {
if (preg_match($falsie, $text)) {
That is already covered here. The problem is that the PHP Versions are pinned to a certain commit as you can see in this file. If now someone fixes something in the docs we only receive changes for PHP 8.5 because its mapped to the master branch.
We should think about something which makes it possible to select certain commits and apply them on the mapped commit or we should rethink the behaviour in general.
For such cases we have the the special_cases.php to fix them manually
For this kind of issues related to official PHP documentation issues, it should be possible to generate the files based on a patched PHP documentation rather than hardcoding special cases or using really specific patterns to detect error types.
The generating process could work like this:
- checkout the commit corresponding to the PHP version,
- apply the documentation patches,
- generate the files as it does currently.
This would be, IMHO, more secure than hardcoding special cases. Indeed, if the parameter list change for an hardcoded case in a future PHP version, unless someone updates the hardcoded function, it will result in a generated function that does not match the new signature.
I agree that is what i was thinking of. but that requires that we need to maintain a commit history for each PHP version manually.
I agree that is what i was thinking of. but that requires that we need to maintain a commit history for each PHP version manually.
It can work with the current mapping to specific commits for each PHP version. If the mapping is frozen, then it just requires to "duplicate" the patches for each version commit, to be sure that it applies correctly.
We should think about something which makes it possible to select certain commits and apply them on the mapped commit or we should rethink the behaviour in general.
I do keep pondering this but everything is a tradeoff bertween accuracy and maintainability; I don't like the current approach either and would love to see somebody come up with something better <3 Ideally the PHP team would do something like Python, where the docs are accurate and in-sync and there's a separate branch of the docs for every release of the stdlib, but alas, PHP gonna PHP 😓