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

Have you tested that? I don't code in PHP, but I'm interested to know what it prints for 15.


It returns 15 Look: http://codepad.org/wsNKZ25Q


sorry my bad, I have updated it.


I think this should be a good lesson for everyone: don't post code without testing it.

There's another point here, though. It seems that you're learning PHP (although in your "About" page you claim that it's one of your skills) so there's no shame in getting things wrong, but aside from learning that you really do need to test even apparently trivial things, it's also good practice to acknowledge other people's contributions, even if only by saying "My thanks to those who pointed out errors in the original." I wouldn't want explicit credit by name, but acknowledging other people is good practice. Look at PG's essays - he regularly thanks people for their feedback.


Hi, I would just like to thank RiderOfGiraffes, adolfoabegg and ColinWright for pointing out a really silly mistake on my part. I should of tested my code before posting it, This is why I love the development community always great people to help out.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

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

Search: