Skip to content

Fix Apache functions return types to reflect the stubs#4076

Merged
Girgias merged 1 commit intophp:masterfrom
scoopandrun:master
Nov 16, 2024
Merged

Fix Apache functions return types to reflect the stubs#4076
Girgias merged 1 commit intophp:masterfrom
scoopandrun:master

Conversation

@scoopandrun
Copy link
Copy Markdown
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
Copy Markdown
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!

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