Which interfaces could class C implement in order to allow each statement in the following code to work? (Choose 2)

Which interfaces could class C implement in order to allow each statement in the following code to work? (Choose 2) $obj = new C(); foreach ($obj as $x => $y) { echo $x, $y;A . IteratorB . ArrayAccessC . lteratorAggregateD . ArrayObjectView AnswerAnswer: A, C

December 19, 2018 No Comments READ MORE +

Which php.ini setting is usually required to use an opcode cache?

Which php.ini setting is usually required to use an opcode cache?A . extensionB . zend_extensionC . optimizerD . dlView AnswerAnswer: B

December 18, 2018 No Comments READ MORE +

Which of these elements can be encapsulated by namespaces and made accessible from the outside?

Which of these elements can be encapsulated by namespaces and made accessible from the outside?A . Only classesB . Classes, functions and constantsC . Classes, functions, constants and variablesView AnswerAnswer: B

December 18, 2018 No Comments READ MORE +

Which of the following will set a 10 seconds read timeout for a stream?

Which of the following will set a 10 seconds read timeout for a stream?A . ini_set("default_socket_timeout", 10);B . stream_read_timeout($stream, 10);C . Specify the timeout as the 5th parameter to the fsockopen() function used to open a streamD . stream_set_timeout($stream, 10);E . None of the aboveView AnswerAnswer: D

December 17, 2018 No Comments READ MORE +

<?xml version="1.0" encoding="utf-8"?

Consider the following XML code: <?xml version="1.0" encoding="utf-8"?> <books> <book id="l">PHP 5.5 in 42 Hours</book> <book id="2">Learning PHP 5.5 The Hard Way</book> </books> Which of the following SimpleXML calls prints the name of the second book? (Let $xml = simplexml_load_file("books.xml"); .) (Choose 2)A . echo $xml->books->book[2];B . echo $xml->books->book[l];C ....

December 16, 2018 No Comments READ MORE +

Which of these statements about PDO is NOT true?

Which of these statements about PDO is NOT true?A . PDO has built-in support for Large Objects (LOBs).B . Placeholders within PDO prepared statements need to be named.C . When something goes wrong, PDO can throw an instance of its own exception class.D . PDO does not emulate missing database...

December 15, 2018 No Comments READ MORE +

Is the following code vulnerable to SQL Injection ($mysqli is an instance of the MySQLi class)?

Is the following code vulnerable to SQL Injection ($mysqli is an instance of the MySQLi class)? $age= $mysqli->real_escape_string($_GET['age']); $name= $mysqli->real_escape_string($_GET['name']); $query= "SELECT* FROM 'table' WHERE name LIKE '$name' AND age= $age"; $results= $mysqli->query($query);A . No, the code is fully protected from SQL Injection.B . Yes, because the $name variable is...

December 15, 2018 No Comments READ MORE +

What is the output of the following code?

What is the output of the following code? var_dump(boolval(new StdClass()));A . bool(true)B . bool(false)View AnswerAnswer: A

December 13, 2018 No Comments READ MORE +

Which of the following is NOT a valid function declaration?

Which of the following is NOT a valid function declaration?A . function x ($x1 = array())B . function x (A $x1)C . function x (A $x1 = null)D . function x ($x1 = $x2)View AnswerAnswer: D

December 10, 2018 No Comments READ MORE +

What will an opcode cache ALWAYS automatically improve?

What will an opcode cache ALWAYS automatically improve?A . Running time of a loop in a PHP scriptB . Efficiency of HTML markup generated by a PHP scriptC . Execution speed of a PHP scriptD . Memory footprint of a PHP scriptE . None of the aboveView AnswerAnswer: E

December 8, 2018 No Comments READ MORE +