php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #78142 Function prototype return value does not contain type in case of failure
Submitted: 2019-06-11 11:36 UTC Modified: 2020-10-19 07:53 UTC
From: mail at marcus dot haase dot name Assigned:
Status: Closed Package: *General Issues
PHP Version: Irrelevant OS: Irrelevant
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: mail at marcus dot haase dot name
New email:
PHP Version: OS:

 

 [2019-06-11 11:36 UTC] mail at marcus dot haase dot name
Description:
------------
The return type for mb-strpos is declared as int, although it can be either int of false, as is explained in the text of the documentation later on. To somebody reading only the call-description but not the textual description, this is misleading.

---
mb_strpos ( string $haystack , string $needle [, int $offset = 0 [, string $encoding = mb_internal_encoding() ]] ) : int
---

---
From manual page: https://php.net/function.mb-strpos
---


Test script:
---------------
Irrelevant

Expected result:
----------------
Remove the PHP7.1 return type


Patches

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-06-11 14:29 UTC] girgias@php.net
-Summary: wrong return type in docs +Summary: Function prototype return value does not contain type in case of failure
 [2019-06-11 14:29 UTC] girgias@php.net
This "issue" has been raised multiple times already and the current stance that I'm aware of is that the doc will not be changed to encompass false as a return value in the prototype.

The main reason for this is that there are so many functions affected that it is unpractical.
 [2019-06-13 08:34 UTC] mail at marcus dot haase dot name
So, the docs will stay wrong, because there are too many errors?

I always held the php documentation in high esteem, I hope, this is not goint to change.
 [2020-10-17 13:32 UTC] cmb@php.net
-Status: Open +Status: Verified -Assigned To: +Assigned To: cmb
 [2020-10-17 13:32 UTC] cmb@php.net
Update: the current stance is that such issues will be fixed, when
proper support for rendering union types[1] is available.

[1] <https://github.com/php/phd/pull/30>
 [2020-10-17 22:11 UTC] cmb@php.net
The following pull request has been associated:

Patch Name: Fix #78142: Function prototype return value does not contain type in …
On GitHub:  https://github.com/php/doc-en/pull/155
Patch:      https://github.com/php/doc-en/pull/155.patch
 [2020-10-19 07:53 UTC] cmb@php.net
-Assigned To: cmb +Assigned To:
 [2020-10-29 16:28 UTC] phpdocbot@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=e4f3cc7f4cb861892d1f45cbb4a8cae1b7653e5c
Log: Fix #78142: Function prototype return value does not contain type in case of failure
 [2020-10-29 16:28 UTC] phpdocbot@php.net
-Status: Verified +Status: Closed
 [2020-10-30 09:45 UTC] phpdocbot@php.net
Automatic comment on behalf of mumumu
Revision: http://git.php.net/?p=doc/ja.git;a=commit;h=061168438bcef6ba794ec319648a19d02bf24c9d
Log: Fix #78142: Function prototype return value does not contain type
 [2020-12-30 11:58 UTC] nikic@php.net
Automatic comment on behalf of mumumu
Revision: http://git.php.net/?p=doc/ja.git;a=commit;h=9be81fe85ec1fa0d006877c429e9b3bee579dc1d
Log: Fix #78142: Function prototype return value does not contain type
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 21:01:36 2024 UTC