php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #37088 Universalize needle/haystack argument order
Submitted: 2006-04-14 19:34 UTC Modified: 2006-04-18 06:45 UTC
Votes:73
Avg. Score:4.8 ± 0.6
Reproduced:67 of 67 (100.0%)
Same Version:41 (61.2%)
Same OS:43 (64.2%)
From: bugzilla at yakasha dot net Assigned:
Status: Wont fix Package: Feature/Change Request
PHP Version: * OS: *
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2006-04-14 19:34 UTC] bugzilla at yakasha dot net
Description:
------------
Please universalize the argument ordering for search functions like strstr & in_array.  It's annoying to have to constantly second guess myself, "Which uses needle/haystack and which is haystack/needle"

Reproduce code:
---------------
<?php
$needle      = "what";
$haystack    = "Is what you're looking for in here?";

$stringFound = strstr($needle, $haystack);

$haystack    = explode(" ", $haystack);
$arrayFound  = in_array($needle, $haystack);

echo "String: " . ($stringFound ? "found\n" : "not found\n");
echo "Array:  " . ($arrayFound  ? "found\n" : "not found\n");
?>

Expected result:
----------------
String: found
Array:  found

Actual result:
--------------
String: not found
Array:  found

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-04-14 20:27 UTC] helly@php.net
Use a decent IDE then.
 [2006-04-16 21:50 UTC] bugzilla at yakasha dot net
Wow.  What an amazingly helpful response.  You're great.  Yes, yes, we should all just change our ides to cope with php's limitations and retardedness.

And whenever php has a problem in a certain area, we should just use exec() to run a perl script right?

Or maybe, just maybe, you could accept suggestions on how to improve the language, think about those suggestions, and discuss with the suggestor as to why you would not want to do something intelligent to make php better.
 [2006-04-17 17:02 UTC] mike@php.net
Or maybe you could read up at the development mailing lists how many times this already has been requested and discussed.
 [2006-04-18 01:58 UTC] bugzilla at yakasha dot net
Or maybe I could follow the instructions on your site for submitting a feature request...  oh wait, I did.

Ok then, I'll submit a new feature request.  Tell me what you think of this subject:

Please don't respond to legitimate bug reports/feature requests with inflammatory, condescending comments.


I, like most, don't have the time or desire to spend a month reading through a development mailing list to find out if a feature request has been proposed/discussed.

I, unlike most, do have the time and desire to search through the bug database to see if a feature request has been submitted before I submit my own.

If I'm willing to spend time doing that, you could take the time to not be an ass.
 [2006-04-18 05:57 UTC] mike@php.net
You assume that your time is more important than ours, so who's the ass here?

EOT.

 [2006-04-18 06:45 UTC] bugzilla at yakasha dot net
Lets see how long it takes me to write an appropriate, non assholistic response.

"We've thought about this and decided against it.  For more information, check the developer mailing list."

About 10 seconds.

So, no, I don't assume my time is more valuable.  I assume that others on this planet have the intelligence to respond with the same common courtesy I show them.

I also assume that if I'm willing to put 30 minutes of work in to make sure I don't waste your time that you can put 10 seconds of your life towards typing, "Thanks, but no thanks."
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 14:01:30 2024 UTC