Declaration of Class 5.4
When writing a class, you should adhere to the following formatting rules:
-Do not have spaces between the method name and the opening parenthesis "(") before its argument list
-The left curly brace "{" is at the end of the declaration statement peer
-The closing curly brace "}" is aligned with the corresponding declaration statement, unless it is an empty statement, "}" should be immediately after "{"
Class Sample extends Object {
int $ivar 1;
int $ivar 2;
function Sample (int $i, int $j) {
ivar$1 = $i;
ivar$2 = $j;
}
function Emptymethod () {}
...
}
-Method and method separated by a blank line
http://www.bkjia.com/PHPjc/532593.html www.bkjia.com true http://www.bkjia.com/PHPjc/532593.html techarticle Declaration of class 5.4 When writing a class, the following formatting rules should be adhered to:-The opening parenthesis before the method name and its argument list "(" Do not have spaces-the left curly brace "{" is located in the declaration statement of the peer ...