Hacker News new | past | comments | ask | show | jobs | submit login

in_array(needle, haystack)

PHP with its argument ordering strikes again :)




... actually,

    if(!IDEMPOTENT_COMMANDS[$cmdname]) { ...
would do, and, assuming dictionary lookups are optimised, is possibly faster.


actually,

   if (! isset(IDEMPOTENT_COMMANDS[$cmdname]))
otherwise you'll get an undefined index notice :)


Indeed. My PHP-fu is a bit rusty... I tested `if(NULL)...` in the REPL and since it was working, I left it at that.


Damn!!! :D




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

Search: