Late static binding is used in PHP to:
A. Load dynamic libraries and extensions at runtime
B. Use caller class information provided in static method call
C. Resolve undefined class names by automatically including needed files
D. Find proper method to call according to the call arguments
An HTML form contains this form element:
When this form is submitted, the following PHP code gets executed:
move_uploaded_file(
$_FILES['myFile']['tmp_name'],
'uploads/' . $_FILES['myFile']['name']
);
Which of the following actions must be taken before this code may go into production? (Choose 2)
A. Check with is_uploaded_file() whether the uploaded file $_FILES['myFile']['tmp_name'] is valid
B. Sanitize the file name in $_FILES['myFile']['name'] because this value is not consistent among web browsers
C. Check the charset encoding of the HTTP request to see whether it matches the encoding of the uploaded file
D. Sanitize the file name in $_FILES['myFile']['name'] because this value could be forged
E. Use $HTTP_POST_FILES instead of $_FILES to maintain upwards compatibility
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
What will the following code piece print? echo strtr('Apples and bananas', 'ae', 'ea')
A. Applas end benenes
B. Epplas end benenes
C. Apples and bananas
D. Applas end bananas
Transactions should be used to: (Choose 2)
A. Prevent errors in case of a power outage or a failure in the SQL connection
B. Ensure that the data is properly formatted
C. Ensure that either all statements are performed properly, or that none of them are.
D. Recover from user errors
Which elements does the array returned by the function pathinfo() contain?
A. root, dir, file
B. dirname, filename, fileextension
C. dirname, basename, extension
D. path, file
Which of the following PHP values may NOT be encoded to a JavaScript literal using PHP's ext/json capabilities?
A. 'Hello, world!'
B. function(){ alert("Hello, world!"); }
C. array('Hello, world!')
D. array('message' => 'Hello, world!')
After performing the following operations: $a = array('a', 'b', 'c'); $a = array_keys(array_flip($a)); What will be the value of $a?
A. array('c', 'b', 'a')
B. array(2, 1, 0)
C. array('a', 'b', 'c')
D. None of the above
What will be the output of the following code?
$a = array(0, 1, 2 => array(3, 4));
$a[3] = array(4, 5);
echo count($a, 1);
A. 4
B. 5
C. 8
D. None of the above