php mcq questions with answers


                                
What XML component does the following XPath query try to match? //foo[bar/@id=5]
A.bar element with an id attribute whose value is equal to 5
B.foo element containing a child node bar tag
C.id attribute whose value is equal to 5
D.foo element with a child note bar whose id attribute is equal to 5
E.all of the foo elements that have a child node bar, whose id attribute is equal to 5
                                
What is the output of the following script? <?php class a { public $val; } function renderVal (a $a) { if ($a) { echo $a->val; } } renderVal (null); ?>
A.A syntax error in the function declaration line
B.An error, because null is not an instance of 'a'
C.Nothing, because a null value is being passed to renderVal()
D.NULL
                                
Transactions can be used to: (Choose 2)
A.Recover from errors in case of a power outage or a failure in the SQL connection
B.Ensure that the data is properly formatted
C.Ensure that either all statements are performed properly, or that none of them are.
D.Recover from user errors
                                
Type hinting in PHP allows the identification of the following variable types: (Choose 2)
A.String
B.Integer
C.Array
D.Any class or interface type
                                

Which of the following statements are TRUE about the .NET CLR?

  1. It provides a language-neutral development & execution environment.
  2. It ensures that an application would not be able to access memory that it is not authorized to access.
  3. It provides services to run "managed" applications.
  4. The resources are garbage collected.
  5. It provides services to run "unmanaged" applications.

A.Only 1 and 2
B.Only 1, 2 and 4
C.1, 2, 3, 4
D.Only 4 and 5
E.Only 3 and 4