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 5B.foo element containing a child node bar tagC.id attribute whose value is equal to 5D.foo element with a child note bar whose id attribute is equal to 5E.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 lineB.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 connectionB.Ensure that the data is properly formattedC.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.StringB.IntegerC.ArrayD.Any class or interface type
Which of the following statements are TRUE about the .NET CLR?
- It provides a language-neutral development & execution environment.
- It ensures that an application would not be able to access memory that it is not authorized to access.
- It provides services to run "managed" applications.
- The resources are garbage collected.
- It provides services to run "unmanaged" applications.
A.Only 1 and 2B.Only 1, 2 and 4C.1, 2, 3, 4D.Only 4 and 5E.Only 3 and 4