Six golden rules in php5.5

Six golden rules in php5.5

There are six golden rules in php to maintain large project.

  1. In a single  php  file, we never write more than one class at a time. Out of the scope of that class, we will not write any procedural code.

       2.      We will save any class with a proper naming convention. For example we
will save the file where we place the Emailer class introduced earlier in this
chapter as  class.emailer.php. What benefits can you achieve using this
naming convention? Well, without going inside that file, you are now at least
confirmed that this file contains a class named “Emailer”.
3.     Never mix the case in filenames. It creates ugly application structure.
Go ahead with all small letters.
4.     Like classes, we will save any interface as , Abstract  Abstract
class as, and Final class as  and Final class as
We will always use Camel case while naming our classes. And that means
the first letters of the major part is always a capital letter and the rest are
small letter. For example a class named “arrayobject” will be more readable if
we write ArrayObject.

5.     While writing the name of properties or class variables, we will follow the
same convention.

6.     While writing the name of a method, we will start with a small letter and
then the rest are camel case. For example, a method to send an email could be
named as sendEmail.


myself pramodh kumar yet another php developer from India and have worked on oops,procedural,yii framework,codeigniter,wordpress,joomla,api and more.

Tagged with: , , , , , , ,
Posted in Six golden rules in php5.5

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Follow Tutorial on
December 2013
« Nov   Jan »
Follow me on Twitter
Blog Stats
  • 78,798 hits
%d bloggers like this: