tags:

views:

301

answers:

3

Can someone tell me if are the answers for this questions are correct

Q: Type-hinting and the instanceof keyword can be used to check what types of things about variables?

Answers (choose 3) a) If a particular child class extends from it b) If they are an instance of a particular interface c) If they are an abstract class d) If they have a particular parent class e) If they are instance of a particular class

A: I think it is (e, d, a)

Q: When embedding PHP into XML documents, what must you ensure is true in order for things to function properly?

Answer: a) Disabling of the short_tags in PHP.ini directives b) Enabling the asp_tags PHP.ini directives c) That you have Xpath support enabled in PHP5 d) That your XML documents are well-formed e) None of the above, PHP can be embedded in XML in all cases

A: I think it is (e)

Q: The following is common XML structure used in service oriented architectures, what does it represent?

<?xml version=”1.0”>
<methodCall>
    <methodName>myMethod</methodName>
    <params>
        <param>
            <value><string>HI!</string></value>
        </param>
    </params>
</methodCall>

Answer a) None of the above b) A fragment of a complete SOAP request c) XML-RPC d) REST e) SOAP

A: I think it is (e)

...and

Q: The MVC pattern in Web development involves which of the following components?

Answers (choose 4) a) View b) Controller c) Validation d) Model e) Front Controller

A: I think it is (a, b, d, c)

A: 

No, they are not all correct (and since that's what the OP asked for, I'll hold off until something in the question changes).

Justin Niessner
How very programmeresque of you to take a sentence in English too literally. We all know what he means.
Bart van Heukelom
@Bart - There's more than simply taking the sentence literally to my answer. Overall it's a poor question that could easily be split into four and asked in a fashion other than, "Here's my test, grade it for me so I don't fail".
Justin Niessner
+1  A: 

Q: Type-hinting and the instanceof keyword can be used to check what types of things about variables?

b, d, e
instanceof: You can check if an object is of class X or is in some form a subclass of X or implements in some form X.
typehinting: allows you to see if a class is an abstract class, but then this would be 4 answers, hmm

Q: When embedding PHP into XML documents, what must you ensure is true in order for things to function properly?

d - You can put PHP code into HTML (but it won't be parsed), and you will have to escape the "<" char

Q: The following is common XML structure used in service oriented architectures, what does it represent?

c

Q: The MVC pattern in Web development involves which of the following components?

a, b, d, e
(Validation should be done, but is not part of the MVC structure, the FrontController dispatches requests)

Tobias P.
The answer to the XML question is wrong! It is `a`, otherwise the XML header `<?xml version="1.0"?>` will fail. Why should PHP care if the document is well formed or not? PHP gets *embedded*. It should not care what is around it.
Felix Kling
@Felix: The question said "in order for things to function properly", not "in order for things to work the way they did without PHP". So I think the XML should be valid or it won't function properly. So I would have thought the answer would include D as well.
MJB
@MJB: Well, could be. But it also says *Q: **When** embedding PHP into XML documents,...* . Of course XML documents should alsways be well formed... but anyway... not that important ;)
Felix Kling
@Felix: I agree. I was just trying to follow the question and your answer. Thanks for humoring me.
MJB
@Felix: When you define that "embedding php into xml documents" means saving an xml.php and putting and xml-document there and want php to fill some gaps (template system), yes then you're right. hmm, seems this is what the intention of the question was, pretty bad specification of the questions scope, could mean everything or nothing.
Tobias P.
A: 

@tobias a special thank you,

for explaining your answers, these are actual practice questions for a certification. Bizarrely, they do not provide any answers which is exceedingly frustrating. you do not have a clear idea of understanding of a particular topic until you do the questions.

i know now where I'm wrong and i have learn't from my mistakes.

... and cheers to all others for helping

getmizanur