Blog Home


Unit Testing X - Creating our Validator Class

Moving validation to a separate class

Unit Testing IX - Testing a Validator Class

Creating a test for a separate validator class using a data provider

Unit Testing VIII - An Improved User Class

Fixing some problems with the user class

Using Namespaces to Avoid Class-name Collisions

PHP namespaces explained, with some examples

Using an Autoloader to Load Classes

How autoloaders work and several example autoload.php files

Fatal Error Cannot Redeclare Class

Fixing the "Cannot redeclare class" PHP error

Using Parameterized Prepared Statements in a Class

Binding statement parameters to class variables so they can be used anywhere in the class

Understanding addPackage(), loadClass(), and getService()

Making sense of the addPackage(), loadClass(), and getService() methods