What is the output of the following code? echo '1' . (print '2') + 3;
A. 123
B. 213
C. 142
D. 214
E. Syntax error
Which of the following methods are available to limit the amount of resources available to PHP through php.ini? (Choose 2)
A. Limit the amount of memory a script can consume
B. Limit the total amount of memory PHP uses on the entire server
C. Limit the maximum execution time of a script
D. Limit the maximum number of concurrent PHP processes
E. Limit the maximum number of concurrent PHP threads
Given the following DateTime object, which sample will NOT alter the date to the value '2014-02-15'? $date = new DateTime('2014-03-15');
A. $date->sub(new DateInterval('P1M'));
B. $date->setDate(2014, 2, 15);
C. $date->modify('-1 month');
D. $date->diff(new DateInterval('-P1M'));
Assuming UTF-8 encoding, what is the value of $count? $count = strlen($data);
A. 0
B. 4
C. 5
D. 7
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 false
B. PHP does that automatically
C. You may only send a particular type of header once
D. Use the header_add() function
Which of the following functions will allow identifying unique values inside an array?
A. array_unique_values
B. array_distinct
C. array_count_values
D. array_intersect
E. array_values
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() and the available database-specific escaping functionality to escape variables to be used in a query.
Which of the following statements is NOT correct?
A. Only methods can have type hints
B. Typehints can be optional
C. Typehints can be references
When a class is defined as final it:
A. Can no longer be extended by other classes.
B. Means methods in the class are not over-loadable.
C. Cannot be defined as such, final is only applicable to object methods.
D. Cannot be instantiated.
What is the length of a string returned by: md5(rand(), TRUE);
A. Depends on the value returned by rand() function
B. 32
C. 24
D. 16
E. 64