feature that should be there and isn't

From: Date: Wed, 31 Jan 2001 04:07:43 +0000
Subject: feature that should be there and isn't
Groups: php.general 
Request: Send a blank email to php-general+get-37407@lists.php.net to get a copy of this message
in php to have a "optional" parameter in a function you can do: function foo($var='') { } To have it be default to 'bar' you can do: function foo($var='bar') { } BUT you can't do this: function foo($var=date("Y-m-d")) { } Why? This would be a kick ass little trick! --Joe -- ------------------------------------------------------------------------------- Joe Stump, PHP Hacker, joestump98@yahoo.com -o) http://www.miester.org http://www.care2.com /\\ "It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V -------------------------------------------------------------------------------

« previous php.general (#37407) next »