In the following code, which classes can be instantiated?
In the following code, which classes can be instantiated? abstract class Graphics { abstract function draw($im, $col); } abstract class Point1 extends Graphics { public $x, $y; } function _construct($x, $y) { $this->x = $x; $this->y = $y; } function draw($im, $col) { lmageSetPixel($im, $this->x, $this->y, $col); } class Point2...
What is the name of the function that allows you register a set of functions that implement user-defined session handling?
What is the name of the function that allows you register a set of functions that implement user-defined session handling?A . session_set_handler()B . session_set_storage_handler()C . session_register_handler()D . session_set_save_handler()View AnswerAnswer: D
Which of the following filtering techniques prevents all cross-site scripting (XSS) vulnerabilities?
Which of the following filtering techniques prevents all cross-site scripting (XSS) vulnerabilities?A . Strip all occurrences of the string <script.B . Strip all occurrences of the string javascript.C . Enable magic_quotes_gpc.D . None of the above.View AnswerAnswer: D
Which technique should be used to speed up joins without changing their results?
Which technique should be used to speed up joins without changing their results?A . Add indices on joined columnsB . Add a WHERE clauseC . Add a LIMIT clauseD . Use an inner joinView AnswerAnswer: A
Which of the following will NOT instantiate a Date Time object with the current timestamp?
Which of the following will NOT instantiate a Date Time object with the current timestamp?A . $date= new DateTime();B . $date= new DateTime('@' . time());C . $date= new DateTime('now');D . $date = new DateTime(time());View AnswerAnswer: D
From your PHP application, how can you send the same header twice, but with different values?
From your PHP application, how can you send the same header twice, but with different values?A . Set the second argument of the header () function to falseB . PHP does that automaticallyC . You may only send a particular type of header onceD . Use the header_add() functionView AnswerAnswer:...
What is the preferred method for preventing SQL injection?
What is the preferred method for preventing SQL injection?A . Always using prepared statements for all SQL queries.B . Always using the available database-specific escaping functionality on all variables prior to building the SQL query.C . Using addslashes() to escape variables to be used in a query.D . Using htmlspecialchars()...
What can be said about the call to file_get_contents?
Consider the following code. What can be said about the call to file_get_contents? $getdata = "foo=bar"; $opts= array('http' => array( 'method' => 'POST', 'header' => 'Content-type: application/x-www-form-urlencoded', 'content' => $getdata ) ); $context = stream_context_create($opts); $result= file_get_contents('http://example.com/submit.php', false, $context);A . A GET request will be performed on http://example.com/submit.phpB . A...
Which of the following statements about exceptions is correct? (Choose 2)
Which of the following statements about exceptions is correct? (Choose 2)A . you can only throw classes derived from ExceptionB . a try block can have multiple catch blocksC . a try block must not be followed by a catch blockD . try blocks cannot contain nested try blocksView AnswerAnswer:...
What is the output of the following code?
What is the output of the following code? var dump(boolval(-1));A . bool(true)B . bool(false)View AnswerAnswer: A