php mcq questions with answers


                                
Which of the following statements about exceptions are correct? (Choose 2)
A.you can only throw classes derived from Exception
B.a try block can have multiple catch blocks
C.a try block must not be followed by a catch block
D.try blocks cannot contain nested try blocks
                                
How many elements does the $matches array contain after the following function call is performed? preg_match('/^(\d{1,2}([a-z]+))(?:\s*)\S+ (?=200[0-9])/', '21st March 2006', $matches);
A.1
B.2
C.3
D.4
                                
What is the output of the following code: str_replace(array("Apple","Orange"), array("Orange","Apple"), "Oranges are orange and Apples are green");
A.Apples are orange and Oranges are green
B.Apples are orange and Apples are green
C.Apples are apple and Oranges are green
D.Apples are apple and Apples are green
                                
Is the following code piece E_STRICT compliant? final class Testing { var $test = 0; public function tester() { return "Tested!"; } }
A.Yes
B.No
                                
What parsing methodology is utilized by the SimpleXML extension?
A.SAX
B.DOM
C.XPath
D.Push/Pull Approach
E.Expat