danyet:

I think the only good thing about PHP being my first programming language is that to this day, when learning a new language, I am pleasantly surprised by how logical and feature-rich and generally not-PHP-like they are.

When your standards are set that low, it’s hard to take things like halfway decent language design for granted.

Okay, that might not be a good thing after all.

My personal favorite PHP inconsistency is in search functions. I have to look this up every time I need to check whether something is contained in a string or array, because, well, I’ll let the documentation speak for itself:

int strpos ( string $haystack , mixed $needle [, int $offset = 0 ] )

bool in_array ( mixed $needle , array $haystack [, bool $strict = FALSE ] )

For the non-programmers who are still confused, look at the positions of ‘needle’ (the thing being searched for) and ‘haystack’ (the thing being searched within) in the above two functions.

  1. mac-cosmetics-offer-code-2012 reblogged this from jacob
  2. waschmaschinen-2012 reblogged this from jacob
  3. festplattenrecorder-test-2012 reblogged this from jacob
  4. dirty-pick-up-lines reblogged this from jacob
  5. tamivendu reblogged this from jacob
  6. buzzingphones reblogged this from jacob and added:
    How does one fail to shuffle?
  7. codeman38 reblogged this from danyet and added:
    My personal favorite...in search functions. I have...check...
  8. pakislash reblogged this from jacob
  9. saltcod reblogged this from jacob and added:
    Love it. PHP hatefully returns the word ‘Array’ constantly on me, but so rarely an actual array.
  10. everglade reblogged this from jacob
  11. jessicantesmeridiano reblogged this from jacob
  12. foldingcookie reblogged this from danyet and added:
    I’m more amused by...can fail. more seriously,...an...
  13. danyet reblogged this from jacob and added:
    I think the only good thing about PHP being my first programming language is that to this day, when learning a new...
  14. nathanmanousos said: you go php
  15. jeehdee reblogged this from jacob
  16. toastr reblogged this from jacob
  17. hashbang said: parameter is address of array
  18. ebriceno reblogged this from jacob
  19. swindsor said: Because u no ruby. ruby-doc.org/core-1….
  20. bebopspider reblogged this from jacob and added:
    useless boolean is useless
Short URL for this post: http://tmblr.co/ZSpucx7vCQ7V
blog comments powered by Disqus