|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #54078 Array / string functions parameter inconsistence
Submitted: 2011-02-23 13:23 UTC Modified: 2018-05-05 20:52 UTC
Avg. Score:4.3 ± 0.9
Reproduced:3 of 3 (100.0%)
Same Version:1 (33.3%)
Same OS:1 (33.3%)
From: martin dot keckeis1 at gmail dot com Assigned:
Status: Wont fix Package: *General Issues
PHP Version: 5.3.5 OS:
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.
Block user comment
Status: Assign to:
Bug Type:
From: martin dot keckeis1 at gmail dot com
New email:
PHP Version: OS:


 [2011-02-23 13:23 UTC] martin dot keckeis1 at gmail dot com
In the string and array functions the $needle and $haystack parameter doesn't have the same order.

From the documentation:
int stripos ( string $haystack , string $needle [, int $offset = 0 ] )
mixed array_search ( mixed $needle , array $haystack [, bool $strict ] )

This is a very confusing inconsistence for me, since I program now PHP for several years, I cannot accustom on this.

And I'm sure not the only one -> maybe a change for the next version 5.4 or 6.0?

Best regards


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2018-05-05 20:52 UTC]
-Status: Open +Status: Wont fix
 [2018-05-05 20:52 UTC]
I've literally never heard of anyone complaining about this before.
 [2018-05-05 20:56 UTC] spam2 at rhsoft dot net
literally everybody using php complains many years about such inconsistencies and similar exists in database functions but sadly change it would be painful now because of a terrible BC break for existing code
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Tue Dec 18 21:01:27 2018 UTC