News for hackers. Stuff that matters.
Re:A look at modern PHP by Apofis on Tuesday May 05, 2020 @11:36AM (#23081160)
Sounds like a jr dev misstep... you're not really bringing up any key points.
Re:A look at modern PHP by ragnese on Tuesday May 05, 2020 @01:05PM (#23082230)
It takes 5 seconds on Google to find a myriad complaints about weird, unexpected, and downright incorrect things that PHP does. That wasn't the point of my reply. The point was that language choice CAN affect productivity. And having a bunch of gotchas is something that will negatively affect productivity. I simply gave the first example that popped into my head that actually tripped me up.
Re:A look at modern PHP by Supermancho on Tuesday May 05, 2020 @01:43PM (#23082651)
Unit tests would have caught this, if you wrote them.
Re:A look at modern PHP by wtetzner on Tuesday May 05, 2020 @02:07PM (#23082898)
Assuming you thought to test using a string that's all digits. You have to know about PHP's brokenness to even think to check that. In a sane language, it doesn't matter what the contents of the strings are, they're just strings.
Re:A look at modern PHP by MrPatan on Tuesday May 05, 2020 @02:06PM (#23082889)
>Unit tests would have caught this, if you wrote them.

If I hadn't considered string-number-keys in my code, I would also have forgotten about them in my unit tests. Maybe you're different.

Re:A look at modern PHP by ragnese on Tuesday May 05, 2020 @02:26PM (#23083107)
My unit tests did not cover all possible strings, unfortunately.