Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Apache functions return types to reflect the stubs #4076

Merged
merged 1 commit into from
Nov 16, 2024

Conversation

scoopandrun
Copy link
Contributor

The stubs for Apache functions apache_request_headers, getallheaders and apache_response_headers are as follows:

<?php

// https://github.com/php/php-src/blob/PHP-8.3.12/sapi/apache2handler/php_functions.stub.php
// https://github.com/php/php-src/blob/PHP-8.3.12/sapi/cgi/cgi_main.stub.php

function apache_request_headers(): array {}

/** @alias apache_request_headers */
function getallheaders(): array {}

function apache_response_headers(): array {}

However, the return types in the docs wrongly include false as a return type for those functions.
There even are some discrepancies within the same page between the Description content and the Return Values section.

This PR aims to fix these inconsistencies.

Copy link
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like it used to be able to return false in PHP 5, thanks for spotting this!

@Girgias Girgias merged commit 68e52ef into php:master Nov 16, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants