Archive for tag ‘PHP’

How to install PHP 5.2, 5.3, and LightTPD on Mac OS X using MacPorts

A few months ago, I was looking for a way to install PHP 5.3 alongside 5.2 on my development machine, a MacBook. Why? It has a lot to do with the new late static bindings and namespaces that have already been committed into PHP’s HEAD. I’ve been anticipating these features for a while now, and I was anxious to try them out.

Special thanks goes to MacPorts’ Ryan Schmidt who helped me out on this thread.

Continued »

Type-safe arrays using PHP’s SPL

For a recent project of mine, I needed to create a type-safe collection of objects in PHP. However, normal PHP arrays don’t support this kind of behavior. I could create a class to do the job, but I’ll have to do a little work to make it function like a real array.

Continued »