DNforum.com - Domain Sales, Domain Forum, Domain Appraisals
 
Register Now! Welcome to Dnforum.com You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast and simple so please, join our community today! If you have any problems with the registration process or your account login, please contact us.
Go Back   DNForum - Domain Sales, Domain Forum, Domain Appraisals, Domain Registrars > Content Development > Website Development and Design Discussion > Coding/Programming/Languages
Reply
 
LinkBack Thread Tools Display Modes
Old 09-01-2005, 09:19 AM   #1 (permalink)
Bob
Jedi Master
 
Bob's Avatar
 
Name: Bob
Last Online: 05-26-2008 07:49 PM
iTrader: (68)
Join Date: Apr 2002
Posts: 2,860
DNF$: 581
Location: Massachusetts
Country:


Overloaded Functions in PHP?

Does PHP support overloaded functions?

This is very handy in C/C++...

I wrote a script with overloaded functions, but but I get an error when trying to run it.

Just curious if anybody know the definitive answer.

-Bob
__________________
Goodbye domainers. It was fun while it lasted. . .
Bob is offline   Reply With Quote
Old 09-01-2005, 01:33 PM   #2 (permalink)
Platinum Lifetime Member
 
mikesherov's Avatar
 
Last Online: 05-03-2008 08:09 PM
iTrader: (44)
Join Date: Jan 2005
Posts: 460
DNF$: 10
Location: NY


Re: Overloaded Functions in PHP?

bob, no overloaded functions in PHP, but you can use "defaults"

function hello($var1,$var2='hi'){
if($var2=="hi") print "hello:";
print $var1;
}

hello('dude'); prints "hello: dude"
hello('dude','hi'); prints "hello: dude"
hello('dude','something'); prints "dude"
__________________
Credit Repair
mikesherov is offline   Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT -4. The time now is 05:11 AM.
Copyright @2001-2008 DNForum.com

Learn Domains
Promote Domains
Research Domains
Buy Domains
Resell Domains
Park Domains
Sell Domains
Build Domains
Host Domains
Trademark Domains
Domain Domains
manage Domains
Appraise Domains