Welcome to Welcome to DNF.com™ - Domain Sales, Domain Forum, Domain Appraisals, Domain Registrars

If you are new to domains and looking to buy, sell and learn about domains then you have come to the right place. DNForum is the largest domain name community on the internet and continues to grow every day. There are over 105,000 domainers on DNForum doing everything from buying domains, selling domains, learning about domains and discussing domains. Take a minute and Register.

Register Today on DNForum IT'S FREE!

Results 1 to 2 of 2
  1. #1
    Jedi Master
    Bob's Avatar
    Join Date
    Apr 2002
    Posts
    3,138
    DNF$
    49,928
    Bank
    0
    Total DNF$
    49,928
    Donate  

    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
    . . .

  2. #2
    Platinum Lifetime Member
    mikesherov's Avatar
    Join Date
    Jan 2005
    Location
    NY
    Posts
    463
    DNF$
    2,143
    Bank
    0
    Total DNF$
    2,143
    Donate  

    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"

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Domain name forum recommended by Domaining.com