Renaming Functions Quizz
| From: | Hellekin O. Wolf | Date: | Fri, 09 Feb 2001 17:17:28 +0000 |
| Subject: | Renaming Functions Quizz | ||
| Groups: | php.qa | ||
| Request: | Send a blank email to php-qa+get-2376@lists.php.net to get a copy of this message | ||
Here is a quizz to test the coding habits and concensus among us for naming stuff in PHP.
Please reply to me personally so I can post a summary of replies next week...
What is it ? / Is this valid [in the new naming scheme]
a - $LongName
b - $Long_Name
c - $long_name
d - $_long_name
e - $_LONG_NAME
f - $longName
g - $LONGNAME
h - $LONG_NAME
i - functionName()
j - FunctionName()
k - function_name()
l -
function my_function($var) {
global $_msg;
if (!empty($_msg))
echo "<p> $_msg </p>\n";
// Do stuff
return $ret;
}
m -
function my_function($var)
{
global $MSG;
if (!empty($MSG))
echo "<p> $MSG </p>\n";
// Do stuff
return $ret;
}
n -
function myFunction($var) {
global $_msg;
if (!empty($_msg))
echo "<p> $_msg </p>\n";
// Do stuff
return $ret;
}
o -
class MyClass {
var $foo;
var $foo_bar;
// Constructor
function MyClass() {
$this->foo = 1;
$this->foo_bar = $this->foo_bar($this->foo);
}
function foo_bar($foo) {
return pow($foo,2);
}
}
p - [Insert any more example here]
hellekin