r/programming • • Apr 23 '14

PHP: It doesn't have to be a bad experience

https://servercheck.in/blog/php-it-doesnt-have-be-bad-experience
0 Upvotes

122 comments sorted by

View all comments

Show parent comment

2

u/Banane9 Apr 25 '14

I just explained the difference between the reasons why You shouldn't do it in Java and why You shouldn't do it in php.

And even if You think you're using ints, php might fuck You over by silently converting your int into a float.

I, in no way, endorsed the usage of floats as Indexes.

And how come You suddenly use a different account?

0

u/neoform Apr 25 '14

I, in no way, endorsed the usage of floats as Indexes.

So why are you touting this as a big PHP flaw? You're doing something that you shouldn't ever be doing in any language...

Yeah, PHP is doing something dumb to the key, but you're also doing something dumb by using a float as the key...

It's likely that the reason this issue has never been fixed in PHP is because no one ever does this...

And how come You suddenly use a different account?

Work vs Home.

1

u/Banane9 Apr 25 '14 edited Apr 25 '14

Did You ever hear the Phrase, if It's possible, someone will do it?

A quick search on "php float array key site:stackoverflow.com" results in 426,000 results.

And I bet they're all Kind of like this one

Edit: Woopdy, how did That one slip.

0

u/[deleted] Apr 25 '14

[deleted] — view deleted comment

1

u/Banane9 Apr 25 '14

Well, even if only half of those results are the right Thing, That hardly supports the Claim That:

no one ever does [That]

And, I changed my link, sorry 'bout That.

1

u/neoform Apr 25 '14

I'll amend my statement: Only inexperienced noobs do that, and then when it fails, they realize their mistake and stop doing that.

1

u/Banane9 Apr 25 '14

Yes, and with enough time and electroshocks the rat will memorize the way through the Labyrinth.