I like the idea.Oren wrote:Hi guys,
I have a good idea, what do you think about opening a PHP optimization forum where people post their code and then we all together combine forces and our knowledge in order to optimize the code and make it simple, small and fast as possible?
...
P.S It was just for the example and I'm not saying that using array_walk() is faster than using foreach() or vise versa - I really haven't got the chance to check it out
I would hope people would post results showing how their code optimized things.
There are some times when what looks like SMALL code will actually use more memory or end up being slower than using a larger block of code. Just because you reduce the number of lines of code doesn't mean it is optimized. It just means you reduced the number of lines of code.
Remember optimization doesn't mean compacting your code to fit on as few lines as possible.
Optimization means creating code that uses less system resources (memory and CPU) and/or executes faster.