
Untitled
By: a guest on
Aug 1st, 2012 | syntax:
None | size: 0.67 KB | hits: 6 | expires: Never
PHP class function naming
class myclass {
public function tempclass () {
echo "default";
}
public function tempclass ( $text ) {
echo $text;
}
}
tempclass('testing'); // ( called after creating the object )
public function tempclass () {
switch ( func_num_args() ) {
case 0:
/* Do something */
break;
case 1:
/* Do something else */
}
}
public function tempclass ( $text = false ) {
if ( $text ) {
/* This method was provided with text */
} else {
/* This method was not invoked with text */
}
}
class myclass {
public function tempclass ($text='Default') {
echo $text;
}
}