RE: [PHP] new warning messages in PHP 4.0.1?

From: Date: Fri, 30 Jun 2000 14:19:48 +0000
Subject: RE: [PHP] new warning messages in PHP 4.0.1?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-4025@lists.php.net to get a copy of this message
> -----Original Message----- > From: Johan Björk [mailto:johan@websidorna.com] > Sent: Friday, June 30, 2000 8:56 AM > To: php-general@lists.php.net > Subject: [PHP] new warning messages in PHP 4.0.1? > > > I was just trying to upgrade a PHP 4.0 prerelease to PHP 4.0.1, > which went okay, until I noticed that the new version is > complaining about "missing argument 1 to function blutti()" ... > and so on. That has never happened in earlier versions! > > If I have a function like: > > function blutti($foo) { > $... > } > > and call it with only blutti(); the error occur. Well, for whatever it's worth, the error is correct. You're defining a function with one argument, and then calling it without any. (A quick cruise through the change log does turn up a few changes to function definition that certainly could have closed whatever loophole you were getting through before.) If you want to make a function argument optional, you need to provide a default value, as in function blutti($foo="bar") { } For more info, see http://www.php.net/manual/functions.arguments.php --- Mark Roedel | "Blessed is he who has learned to laugh Systems Programmer | at himself, for he shall never cease LeTourneau University | to be entertained." Longview, Texas, USA | -- John Powell

« previous php.general (#4025) next »