Which methods can be used to overload object properties? (Choose 2)
A. set(), get()
B. __set(), __get()
C. __put(), __receive(), __exists()
D. set(), get(), isset()
E. __isset(), __unset()
Under what condition may HTTP headers be set from PHP if there is content echoed prior to the header function being used?
A. headers_sent() returns true
B. Output buffering is enabled
C. The client supports local buffering
D. The webserver uses preemptive mode
Which of the following is NOT a requirement for file uploads to work?
A. The PHP directive file_uploads must be set to On
B. The form's method attribute must be set to "post"
C. The form must include a hidden input element with the name set to "MAX_FILE_SIZE"
D. The form's enctype attribute must be set to "multipart/form-data"
What is "instanceof" an example of?
A. a boolean
B. an operator
C. a function
D. a language construct
E. a class magic
Which of the following is true about stream contexts? (Choose 2)
A. A context can modify or enhance the behavior of a stream
B. A context indicates what session the stream is part of
C. A context is a set of parameters and stream wrapper specific options
D. Contexts are created with new Stream_Context();
What is the result of the following code?
class T
{
const A = 42 + 1;
}
echo T::A;
A. 42
B. 43
C. Parse error
Which of these databases is NOT supported by a PDO driver?
A. Microsoft SQL Server
B. SQLite
C. Microsoft Access
D. Berkeley DB
Which of the following functions are used to escape data within the context of HTML? (Choose 2)
A. htmlentities()
B. addslashes()
C. stripslashes()
D. strip_tags()
E. htmlspecialchars()
In a shared hosting environment, session data can be read by PHP scripts written by any user. How can you prevent this? (Choose 2)
A. Store session data in a different location with session.save_path .
B. Store session data in a database.
C. Enable safe_mode .
D. Set session.name to something unique.
Given the following DateTime objects, what can you use to compare the two dates and indicate that $date2 is the later of the two dates?
$date1 = new DateTime('2014-02-03');
$date2 = new DateTime('2014-03-02');
A. $date2 > $date1
B. $date2 < $date1
C. $date1->diff($date2) < 0
D. $date1->diff($date2) > 0
What is the output of the following code?
class Bar {
private $a = 'b';
public $c = 'd';
}
$x = (array) new Bar();
echo array_key_exists('a', $x) ? 'true' : 'false';
echo '-';
echo array_key_exists('c', $x) ? 'true' : 'false';
A. false-false
B. false-true
C. true-false
D. true-true
What is the output of the following code? echo "22" + "0.2", 23 . 1;
A. 220.2231
B. 22.2231
C. 22.2,231
D. 56.2
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
What is the name of the header used to require HTTP authentication?
A. Authorization-Required
B. WWW-Authenticate
C. HTTP-Authenticate
D. Authentication-Required
E. HTTP-Auth