What is a null object, and when are they useful?

Tags:

If you’ve written code, you’ve probably used the value null to indicate some variable is not set. This is perfectly good, but did you know there’s more to nulls than just the value null? There is also a null object, which doesn’t really have anything to do with the value null, but its purprose is similar. How many times have …

Unit testing 3: Writing tests for existing code

Tags:

Now that you know what unit testing is and how to write and run tests, it’s time to look at writing tests in more depth. Today we’ll take an example class and write tests for it. We’ll also introduce some common testing methodologies.

Refactoring

Tags:

Today I’d like to point out a bunch of good articles about refactoring – the process of improving code without changing the functionality. Sameer Borate has written four posts about the topic in his blog, and I encourage you to check them out: Refactoring: An introduction to PHP programmers Refactoring 1: Conslidate conditional expressions Refactoring 2: Extract method Refactoring 3: …

Doctrine vs. Propel: 2009 update

Tags:

The best PHP ORM libraries, Doctrine and Propel. Last year I compared them to each other, and now it’s time to get a fresh look at how they have advanced in about a year – Is Doctrine still the better of the two? This time, I’ll also look at the features of each in more depth.

PHP Magic Features

Tags:

I wrote an article for Packt Publishing about PHP’s magic features: Magic functions, methods and constants. The article has now been published on Packt’s website, and you can read it here!