I was working on part of my latest pet project in PHP and, obsessive that I am, I wrote four different versions using various programing design strategies.
I have documented and summarized my findings. Here is an excerpt:
"This text documents four different PHP programming styles. My meaning of "style" here is less to do with brace alignment and whitespace than with program structure or orientation. (I am aware of other definitions of these words and purposely am being slightly vague.) I have endeavored to portray some of the very basic yet different styles by providing working examples.
I offer four versions of an example program that I came up with which will stress (but not too much) the mixture of PHP and HTML: the use of an array of data to be displayed in a TABLE. Minor perhaps in the overall scheme of things, but important enough for what I want to demonstrate. It is a working example; it provides a list of all files in the current directory and three functions: open the file, delete the file, and to create a new file. (The code to actually perform those particular actions has been left out but everything else works and it will be easy to add those features.)"
Read more here: Anatomy of Style