1. Question:What is object cloning? 

    Answer

    To remedy the problems with copying, PHP offers an explicit means for cloning an object is known as object cloning.


    1. Report
  2. 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
  3. 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
  4. 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
  5. Question:Define exceptions? 

    Answer

    When a specified error (exceptional) condition occurs in the script is called an exception.
    There are Four important keywords of exceptions:
    Try
    Catch
    Throw
    Finaly


    1. Report
  6. Question:What are default session time and path? 

    Answer
    - Default session time in PHP is 1440 seconds or 24 minutes.
    - Default session save path id temporary folder /tmp

    1. Report
  7. Question:How many ways you can write into a file? 

    Answer

    We can write into a file using the following mode:   

    r+,
     W,  
    w+,
    A,
    a+,
    X,
    x+


    1. Report
  8. Question:

    What is the functionality of the function strstr and stristr?

     

    Answer

    strstr: It returns the remainder of a string beginning with the first occurrence of a predefined string.

    stristr: same as strstr except the search of for the pattern is case insensitive. 

     


    1. Report
  9. Question:

    What is the difference between ereg_replace() and eregi_replace()?

     

    Answer

    ereg_replace(): it is used to find and replace a pattern with a replacement string.

    eregi_replace(): same as ereg_replace() except the search of for the pattern is case insensitive. 


    1. Report
  10. Question:What are the different functions in sorting an array?Discuss them? 

    Answer

    sort(): sort array in ascending order.

    rsort():sort array in descending order.

    asort() : Sort array  in ascending order with key/value.

    arsort(): reverse of assort.

    ksort(): sorts an array by its keys.

    krsort():reverse of ksort


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