As Pierre wrote before sometimes you need functions you usually would say "no, you’ll never need this, this task can be done with just one line PHP" but later you see "Okay, now I could use it".
We had such a situation a few days ago: Thorsten once complained that PHP has functions for everything but no is_negative(). We all in the office, including Pierre, knew that we don’t need such a function since everybody should be able to do this using the < or > operators and would neeevvveeeerrr demand it. A few weeks later, Thorsten and Pierre are working on a project where they are doing some complex calculations and Pierre recognizes the need for such a function. As a result I can present you our companies new friend: is_negative().
If you are doing so very complex applications you shouldn’t be using PHP if you want to do it fast, but instead write the backend in C as an extension.
When you have the choice this is the way. When not… :)
just make it a user defned function inside your database :-)
nobody will know that way :-)
The two main advantages are better support for multi-threaded environments (allocations don’t need to do any mutual exclusion locks) and after each request freeing the allocated memory blocks is much more efficient. As this is an underlying infra-structure change you will not notice it directly as the end-user.