Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7985971
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T11:42:47+00:00 2026-06-04T11:42:47+00:00

I am studying PHP and there is polymorphism example at the website i am

  • 0

I am studying PHP and there is polymorphism example at the website i am studying at,
The Link for the Code:Pastebin, What i didn’t understand is why Class b and Class c after those classes that have been extended with the function hellow when they are already contain this function, i know that this is how the polymorphism works, and i am not sure but i remember some one told me that 2 functions with same name can be in one class becouse each function has it own signature, but has i say i am not sure if can some one help me to understand it please i will be very thankful.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T11:42:48+00:00Added an answer on June 4, 2026 at 11:42 am

    You are not talking about polymorphism here, but very simple inheritance. Multiple methods with the same name but different signatures are indeed possible in some OOP languages (like Java), but not PHP, where method names are unique in a class.

    In your case, class b and c hello methods will simply replace (overload) the one already defined in a, which they extend.

    But, from your b and c class, you may want to call a parent class method. That’s exactly what a::hello($arg1, $arg2, date('Y-M-j')); does.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been started studying PHP in my spare time, and the first code example
I am just studying other user's PHP code right now to understand and learn
I just saw this code while studying the wordpress source code (PHP), You can
I'm studying Python, after a lot of PHP experience, and it would be handy
All, I am studying some sample code given in my web dev class as
I'm studying this code: http://www.w3style.co.uk/a-lightweight-and-flexible-front-controller-for-php-5 In it the author uses a static function to
I'm studying http://www.php.net/manual/en/function.dns-get-record.php and there seems to be no option to set a custom
While studying for the Zend PHP Exam I came across the following contradicting information:
I'm studying for the Zend PHP certification . I am not sure about the
In studying actionscript 3's graphics class, I've come across the undocumented drawRoundRectComplex() method. It's

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.