logo

CuriousTab

CuriousTab

Discussion


Home Interview Technology Comments

  • Question
  • What type of inheritance that PHP supports? Provide an example.


  • Correct Answer
  • PHP supports single level inheritance Inheriting a class would mean creating a new class with all functionality of the existing class in addition to some more The created class is called as a subclass of the parent class Parent is a keyword which we use to access members of a parent class Inheritance is usually defined by using the keyword ?Extend? $this is used a reference to the calling object Inheritance avoids redundancy of code Example: Class employee extends manager : Here Employee is a subclass of manager Echo $this->name can be used to echo variable name of the parent class 


  • Technology problems


    Search Results


    • 1. Explain how to create random passwords.
    • Discuss
    • 2. Explain how to store the uploaded file to the final location.
    • Discuss
    • 3. Explain how to send large amounts of emails with php.
    • Discuss
    • 4. Explain Superglobal variables in PHP .
    • Discuss
    • 5. Explain how to work with Permissions in PHP.
    • Discuss
    • 6. Explain when to use GET or POST. Provide example for both the ways.
    • Discuss
    • 7. How to set cookies in PHP?
    • Discuss
    • 8. What Is a Session in PHP?
    • Discuss
    • 9. How can we encrypt the username and password using PHP?
    • Discuss
    • 10. Explain the changing file permission and ownership using PHP's chmod() function.
    • Discuss


    Comments

    There are no comments.

Enter a new Comment