Q:

Import package or autoloading for PHP?

What solution would you recommend for including files in a PHP project?

There aren't manual calls of require/include functions - everything loads through autoload functions
Package importing, when needed.

Here is the package importing API:
import('util.html.HTMLParser');
import('template.arras.*'); 

In this function declaration you can explode the string with dots (package hierarchy delimeter), looping through files in particular package (folder) to include just one of them or all of them if the asterisk symbol is found at the end of the string, e.g. ('template.arras.*').
One of the benefits I can see in package importing method, is that it can force you to use better object decomposition and class grouping.
One of the drawbacks I can see in autoload method - is that autoload function can become very big and not very obvious/readable.
What do you think about it?

What benefits/drawbacks can you name in each of this methods?
How can I find the best solution for the project?
How can I know if there will be any performance problems if package management is used?

A:

I use __autoload() extensively.  The autload function that we use in our application has a few tweaks for backwards compatibility of older classes, but we generally follow a convention when creating new classes that allow the autoload() to work fairly seemlessly:

Consistent Class Naming: each class in its own file, each class is named with camel-case separated by an underscore.  This maps to the class path.  For example, Some_CoolClass maps to our class directory then 'Some/CoolClass.class.php'.  I think some frameworks use this convention.
Explicitly Require External Classes: since we don't have control over the naming of any external libraries that we use, we load them using PHP's require_once() function.

