Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It never made sense. The original hash bucketing mechanism for the function lookup in PHP was the length of the name of the function, so each new function was named a specific length to ensure the function list was evenly distributed across the hash table.


Can you link or be more clear? I assumed you are talking about the array and string related functions that are not consistent in argument order.


The parent comment is referring to https://news-web.php.net/php.internals/70691 (found via https://news.ycombinator.com/item?id=6919216). Quoting from that link:

  Well, there were other factors in play there. htmlspecialchars was a
  very early function. Back when PHP had less than 100 functions and the
  function hashing mechanism was strlen(). In order to get a nice hash
  distribution of function names across the various function name lengths
  names were picked specifically to make them fit into a specific length
  bucket. This was circa late 1994 when PHP was a tool just for my own
  personal use and I wasn't too worried about not being able to remember
  the few function names.


Thanks, I did not know that bit of history.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: