note 31466 added to language.oop

From: Date: Wed, 23 Apr 2003 04:29:31 +0000
Subject: note 31466 added to language.oop
Groups: php.notes 
Request: Send a blank email to php-notes+get-46962@lists.php.net to get a copy of this message
Even though you can't set a default value for an argument like this: function foo($bar = 'rar') { // do stuff } You can use the func_get_arg, func_get_args, and func_num_args on class methods. function foo() { $bar = func_num_args >= 1 ? func_get_arg(0) : 'rar'; } -- http://www.php.net/manual/en/language.oop.php http://master.php.net/manage/user-notes.php?action=edit+31466 http://master.php.net/manage/user-notes.php?action=delete+31466 http://master.php.net/manage/user-notes.php?action=reject+31466

« previous php.notes (#46962) next »