3 ms·
Sad in what sense?
by maxpert 14y ago
Sad in what sense?
- beezee 14y agoSad is definitely overkill here, especially for such a short snippet, but personally I prefer avoiding nested conditionals and else statements in general. Here's a fork that keeps conditional clauses to one line, and I personally find much more readable - https://gist.github.com/3029246 https://gist.github.com/3029246 (disclaimer- not tested at all)
- maxpert 14y agoThanks for forking and keep improving, I wish PHP guys do it at a native level too.
- nodrama 14y agoI think he means sad in the sense that this should not be in application code. It should be in PHP interpreter. Fixing the interpreter in application code. Sad.
- gburt 14y agoIn the same sense as code that uses call_user_func_array is dirty looking. It's cruft that has nothing to do with application logic. It'd be nice to be able to do away with these things.