Better to have a single file of classes or multiple?
I'd like some opinions on this; and not specifically just for PHP. Is it better to have a single file composed of classes or is it better to have a single file for each class?
__________________ Coding is a challenge, get used to it Always remember to debug Try the guess & check method Break it down into simple steps
C# and Java require separate files. Multiple classes within are nested and owned by the outer class.
PHP should do the same, especially with chain-able autoload extensions and the use keyword with namespaces.
__________________
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php