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

When gcc warns you, it tells you to wrap it in parens if you really mean it: "warning: suggest parentheses around assignment used as truth value". Your PHP example wouldn't raise a warning from gcc, because it already is.

I find assignment-in-conditional more useful in loops than if's, since you can't just plonk the assignment on the previous line.



Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: