Skip to content

Instantly share code, notes, and snippets.

@flacodirt
Last active December 15, 2015 18:09
Show Gist options
  • Save flacodirt/5301755 to your computer and use it in GitHub Desktop.
Save flacodirt/5301755 to your computer and use it in GitHub Desktop.
Coding Standards from PEAR in quick-reference format

Coding Standards from PEAR in quick-reference format

Indenting and Line Length

  • Use an indent of 4 spaces, with no tabs
  • Line length of 75-85 characters

Control Structures

  • Control statements should have one space between the control keyword and opening parenthesis.
    • Example: if (condition) {
  • Split long if statements onto several lines
    • Indent 4 characters
    • Logical operators at beginning of line
    • Closing parenthese and opening brace on own line
    • Example:
if (condition1  
|| condition2  
&& condition3  
) {
// code
}
- Example:
$a = $b
? $c
: $d;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment