IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New It's an index vs. value thing.
array_key_exists() and isset() both look at the array's key, which *is* the hash-table lookup. It's wicked fast: probably the fastest thing you can do with an array in PHP.

in_array() looks in the array's *values*. These are *not* in a hash-table and is therefore much much much slower.

Wade, who is paid to know this stuff.

Q:Is it proper to eat cheeseburgers with your fingers?
A:No, the fingers should be eaten separately.
New Ahh, but look at my corrected* version
You're checking if the array key exists in the second dimension of the array. I'm checking for the value in the first dimension. Both versions are looking at the same hash.


* I had the parameters reversed until I just now updated it.
--

Drew
New Why is this an argument?
in_array == bad for large sets.
Dead end on this path.
New Because I didn't read all the comments on that thread
Which I now have. So I now understand that the keys are indexed, but the values are not.
--

Drew
New Good
I love educational threads.
New Thank you...
Sister Barry Catherine.

Please no rulers today!
New I prefer the gentle approach
Like my daughter says to me all the time:

GET OUT OF MY HEAD!

I never tell her what to do or think. But little anecdotes and hints are enough to send the wheels spinning. She hates that.
     PHP vs Perl questions - (crazy) - (17)
         Ooops, - (crazy)
         Try this - (drook) - (15)
             Here's a better version. - (static) - (14)
                 Why better? - (drook) - (13)
                     Well, it depends on what defined() means in PERL. - (static) - (12)
                         So two issues - (drook) - (11)
                             That's the problem - (crazy) - (10)
                                 *All* arrays in PHP are hashes - (drook) - (9)
                                     Big difference - (crazy)
                                     Multiple orders of magnitude difference - (crazy) - (7)
                                         It's an index vs. value thing. - (static) - (6)
                                             Ahh, but look at my corrected* version - (drook) - (5)
                                                 Why is this an argument? - (crazy) - (4)
                                                     Because I didn't read all the comments on that thread - (drook) - (3)
                                                         Good - (crazy) - (2)
                                                             Thank you... - (folkert) - (1)
                                                                 I prefer the gentle approach - (crazy)

Obeying the Law of Unintended Consequences since 2001.
63 ms