Blog Home


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