Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Tip
titlecorrect
Code Block
languagephp
titlemy_class.php
linenumberstrue
<?php 
class MyClass {
}
?>

 

Methods

Method names should begin with a lowercase letter and be camelCased. Type hinting should be used whenever possible, but must conform to PHP 5.1 (i.e. only objects and arrays may be defined using type hints).

Warning
titleIncorrect
Code Block
languagephp
public function CalcDistance($time, $velocity) {
    return $time*$velocity;
}
Tip
titleCorrect
Code Block
languagephp
public function calcDistance($time, $velocity) {
    return $time*$velocity;
}

Comments

There are three types of comments that may be used in PHP. They are block comments (/* */), inline comments (//), and shell comments (#).

...