57. if (($a == $b)
and ($b == $c)
or ($a == $e)
){
$a = $d;
}
58. if($arg === true) {
//do something here
}
elseif($arg === null) {
//do something else here
}
else {
//catch all do something here
}
條件式 if 括號旁邊請留一個空白
67. switch ($var) {
case 0:
echo 'First case, with a break';
break;
case 1:
echo 'Second case, which falls through';
// no break
case 2:
case 3:
echo 'Third case, return instead of break';
return;
default:
echo 'Default case';
break;
}
83. /**
* Documentation Block Here
*/
class Session
{
// all contents of class
// must be indented four spaces
public function test() {}
}
84. /**
* Documentation Block Here
*/
class Session
{
/**
* Documentation Block Here
*/
public function get_flash($name, $data)
{
$closure = function($a, $b) {
// Your closure code here
}
}
}
86. /**
* Documentation Block Here
*/
class Session
{
var $test = null;
/**
* Documentation Block Here
*/
function get_flash($name, $data)
{
// Your code here
}
} 請勿使用 var 定義變數