Can you give some examples of your own best practices, or personal experiences?
When I design, I'm concerned with A. Maintainability and B. Development speed. I want to be able to develop more features in less time, while writing code that is easy to maintain / change / extend / optimize (all of those I consider maintainability), not only for me but for other developers that might be working on the same source code. In order to achieve this I employ the following practices (some of those might sound very basic, but I'm not making any assumptions):
1. Coding standards - I think it's very important to pick standards you are comfortable with and stick with them almost religiously. Coding standards help normalize the structure of code, increase readability and maintain consistency throughout. I use the PEAR/ZF coding standards -
http://framework.zend.com/manual/en/cod ... style.html. Commenting is a part of that, and I use the phpDoc block comment style.
2. Scoping and modularization - Separating different parts of the application into separate "modules" and making sure each runs in a separate, clean scope is very important for maintainability. For this purpose I model everything in classes (I consider OO to be the best scoping mechanism PHP has to offer), separate functionality as much as possible to different methods, and make sure the absolute minimum runs in the root application scope.
3. Code reuse - as much as possible, reusable code should be encapsulated and de-coupled. I use inheritance where needed, composition where possible in order to put together functionality from reusable building blocks. This affects both maintainability and development speed - if you can control repeating logic from one place you can make changes much easier, if you can reuse logic - you save development efforts.
4. Framework(s) - A natural lead off from code reuse. When the most generic, repeatable logic can be separated from domain implementation, it should be put together in a framework. When those reusable logic blocks can be reused in other projects, they save a ton of time in development. I'm not promoting any particular framework (I use ZF by the way

), using an OS one or a commercial one or a home brewed one doesn't matter - as long as it saves development time. From personal experience I found that using more mature frameworks that many developers test everyday in practice is quite beneficial and that's my reason for using Zend's.
5. Tests - (Unit) Tests help raise the quality of code by validating certain aspects of it repeatedly and quickly. Testable code usually exudes other desirable qualities - such as high decoupling and better interface. Tests help protect against change and help the refactoring process (which is another important part of development).
6. Design patterns - Using widely accepted good (best?) solutions when appropriate instead of trying to roll your own each time in my experience is very beneficial. Design patterns are reusable (hence I should probably have this solution in my framework

), increase de-coupling (mostly) and usually increase maintainability (if applied correctly). I'm not talking implementations of design patterns, but the pattern itself to solve common problems.
7. Domain modeling - I usually start by modeling the structure of the storage system (if one is present). In most projects, this means I start with my database modeling and later model my domain classes after that structure. I find this usually helps flesh out the relationships inherent in the domain and most often some refactoring as those relationships reveal themselves.
8. Refactoring - I refactor my code constantly to help it increase in the qualities I mentioned - readability, reusability, maintainability etc.
There are probably some things I forgot, but those are my main practices as I design and implement my code.