15 Questions on PHP - Please read and answer

Discussion in 'PHP' started by KingCobra, Oct 22, 2009.

  1. #1
    Q-1: Late php versions support remote file accessing for the functions:
    (answer would be single)
    a. include()
    b. include_once()
    c. require_once()
    d. All of the above

    Q-2: Which of the following statements is correct with regard to final and abstract?
    (answer would be single)
    a. An abstract class cannot have final methods
    b. An abstract class cannot have non abstract methods
    c. An final class cannot have abstract methods
    d. An final class cannot have final methods

    Q-3: Which of the following are used for code reuse?
    (answer would be single or multiple)
    a. loops
    b. functions
    c. database
    d. include files

    Q-4: Given bellow is a small php script:
    <?php
    class person{
    function getSal()
    {
    ....
    ....
    }
    }
    class emp extends person{
    function getSal()
    {
    ???
    }
    }
    ?>

    The getSal() of emp has to behave exactly as getSal() of person. Which of the following lines of code would you use to replace the '???' ?

    (answer would be single or multiple)
    a. parent::getSal();
    b. person::getSal();
    c. parent::getSal;
    d. person::getSal;

    Q-5: Which of the following functions output text?
    (answer would be single or multiple)
    a. echo()
    b. print()
    c. println()
    d. display()

    Q-6: Which of the following are not considered as boolean False?
    (answer would be single or multiple)
    a. FALSE
    b. 0
    c. "0"
    d. "FALSE"
    e. 1
    f. NULL

    Q-7: Variable functions in PHP don't work directly with:
    (answer would be single)
    a. echo()
    b. isset()
    c. print()
    d. All of the above

    Q-8: What is true regarding $a + $b where both of them are arrays?
    (answer would be single or multiple)
    a. Duplicated keys are NOT overwritten
    b. $b is appended to $a
    c. The + operator is overloaded
    d. This produces a syntax error

    Q-9: Does PHP 5 supports exceptions?
    (answer would be single)
    a. Yes
    b. No

    Q-10: Which of the following is used to maintain the value of a variable over different pages?
    (answer would be single)
    a. static
    b. global
    c. session_register()
    d. None of this above

    Q-11: The value of local variable of a function has to be retained over multiple calls to that function. How should that variable be declared?
    (answer would be single)
    a. local
    b. global
    c. static
    d. None of the above

    Q-12: Which of the following variables are supported by 'str_replace()' function?
    (answer would be single or multiple)
    a. Integer
    b. String
    c. Boolean
    d. Array

    Q-13: Which of the following is not supported in PHP5 ?
    (answer would be single)
    a. Type Hinting
    b. Reflection
    c. Magic Methods
    d. Multiple Inheritance
    e. Object Cloning

    Q-14: Which composite data types are supported by php?
    (answer would be single or multiple)
    a. Array
    b. Enumeration
    c. List
    d. Object
    e. Integer

    Q-15: You are using sessions and session_register() to register objects. There objects are serialized automatically at the end of each PHP page and are de-serialized automatically on each of the followingpages. Is this true or false?
    (answer would be single)
    a. True
    b. False
     
    KingCobra, Oct 22, 2009 IP
  2. KingCobra

    KingCobra Well-Known Member

    Messages:
    289
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    103
    #2
    Answer as many as you can.
     
    KingCobra, Oct 22, 2009 IP
  3. JAY6390

    JAY6390 Peon

    Messages:
    918
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #3
    So you want people to complete your assignment????
     
    JAY6390, Oct 22, 2009 IP
  4. KingCobra

    KingCobra Well-Known Member

    Messages:
    289
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    103
    #4
    No. Actually I have faced this questions and I thik some of answer was wrong.
    This is why I have posted here to learn correct answer from all of you.
    And also I think it will helpfull for every PHP developer.
     
    KingCobra, Oct 22, 2009 IP
  5. organicCyborg

    organicCyborg Peon

    Messages:
    330
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Which answers do you think are wrong? Or which questions do you want explained?
     
    organicCyborg, Oct 22, 2009 IP
  6. KingCobra

    KingCobra Well-Known Member

    Messages:
    289
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    103
    #6
    organicCyborg,
    I don't need explain. Just give the answer how many you can.
    example: 14. a, d
    Please help me giving answer. cause I need to give reexam on the same question if become fail.

    Thanks
     
    KingCobra, Oct 22, 2009 IP
  7. JAY6390

    JAY6390 Peon

    Messages:
    918
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #7
    :rolleyes:
     
    JAY6390, Oct 22, 2009 IP
  8. plog

    plog Peon

    Messages:
    298
    Likes Received:
    11
    Best Answers:
    1
    Trophy Points:
    0
    #8
    Sure, I'll help you do your homework. In no particular order:

    a;e;b;b;a,c,d;b;b;a,b;d;a;e;b;c;c;d;

    (semi-colons seperate questions, commas seperate multiple answers of one question.

    Ok, now on to that discussion you were talking about. I'm not entirely certain about that 2nd 'b', it was between that and 'c' and I just took an educated guess. What's your thoughts? Also, for the 4th 'c', I didn't like any of the answers and that seemed the less wrong--did you think the same thing?
     
    plog, Oct 22, 2009 IP
  9. LOD

    LOD Member

    Messages:
    319
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    35
    #9
    it feels like giving exam... better avoid this...
     
    LOD, Oct 23, 2009 IP
  10. KingCobra

    KingCobra Well-Known Member

    Messages:
    289
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    103
    #10
    plog ,

    What the hell you answered ?? I think you just type some character without showing questions.
     
    KingCobra, Oct 23, 2009 IP
  11. izzatz13

    izzatz13 Active Member

    Messages:
    541
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    60
    #11
    How about you paid someone. Then you can see some real answer.

    Just my 0.02 :D
     
    izzatz13, Oct 23, 2009 IP