1. Question:

    What type of inheritance that PHP supports?

     

    Answer

    PHP generally supports single type of inheritance.Allthough All inheritance are supported but multiple not supported and replace by inheritance used in PHP5.


    1. Report
  2. Question:Difference between array_merge() and array_slice()?

     

    Answer

    Array_merge():
    The array_merge() function merges arrays together, returning a single, unified array.

    Array_slice(): The array_slice() function returns a section of an array based on a starting and ending offset value.

    1. Report
  3. Question:What are class and object? 

    Answer
    Class: Classes are intended to represent those real-life items that coder like to manipulate within an application.

    Object: A class provides a basis from which you can create specific instances of the entity the class models, better known as object.That means, an instance of class is called object . Such as $employee = new Employee();

    1. Report
  4. Question:How to initiate a session in PHP? 

    Answer
    The use of the function session_start() lets us activating a session.

    1. Report
  5. Question:Are Parent constructors called implicitly inside a class constructor? 

    Answer
    No, a parent constructor have to be called explicitly as follows:
    
    parent::constructor($value)

    1. Report
  6. Question:What does $GLOBALS means? 

    Answer
    $GLOBALS is associative array including references to all variables which are currently defined in the global scope of the script.

    1. Report
  7. Question:What are the advantages of object-oriented programming?

     

    Answer
    a.   Simplicity
    b.   Modifiability
    c.   Re-usability.
    d.   Extensibility
    e.   Catch errors at compile time rather than at runtime
    f.    Reduce large problems to smaller

    1. Report
  8. Question:What does $_SERVER means? 

    Answer
    $_SERVER is an array including information created by the web server such as paths, headers, and script locations.

    1. Report
  9. Question:What is object cloning? 

    Answer
    Ans: It is difficult to copy an object, because all objects are treated as references rather than as values. If we try to copy a referenced object, it will simply point back to the addressing location of the original object. To remedy the problems with copying, PHP offers an explicit means for cloning an object is known as object cloning.


    1. Report
  10. Question:How can we determine whether a variable is set? 

    Answer
    The boolean function isset determines if a variable is set and is not NULL.

    1. Report
Copyright © 2024. Powered by Intellect Software Ltd