In the following code, which line should be changed so it outputs the number 2:
class A {
protected $x = array(); /* A */
public function getX() { /* B */
return $this->x; /* C */
}
} $a = new A(); /* D */ array_push($a->getX(), "one");
array_push($a->getX(), "two");
echo count($a->getX());
A. No changes needed, the code would output 2 as is
B. Line A, to: protected and$x = array();
C. Line B, to: public function andgetX() {
D. Line C, to: return and$this->x;
E. Line D, to: $a =and new A();
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)
What can prevent PHP from being able to open a file on the hard drive (Choose 2)?
A. File system permissions
B. File is outside of open_basedir
C. File is inside the /tmp directory.
D. PHP is running in CGI mode.
How can you determine whether a PHP script has already sent cookies to the client?
A. Use $_COOKIE
B. Use the getcookie() function
C. Use the headers_sent() function
D. Use JavaScript to send a second HTTP request
Your application uses PHP to accept and process file uploads. It fails to upload a file that is 5 MB in size, although upload_max_filesize is set to "10M". Which of the following configurations could be responsible for this outcome? (Choose 2)
A. The PHP configuration option post_max_size is set to a value that is too small
B. The web server is using an incorrect encoding as part of the HTTP response sent to the client
C. The browser uses an incorrect encoding as part of the HTTP request sent to the server
D. The hidden form field MAX_FILE_SIZE was set to a value that is too small
E. PHP cannot process file uploads larger than 4 MB
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.
Which PHP function retrieves a list of HTTP headers that have been sent as part of the HTTP response or are ready to be sent?
A. header()
B. headers()
C. headers_list()
D. headers_sent()
E. getresponseheaders()
What is the pattern modifier for handling UTF-8 encoded preg_* functionality?
A. e
B. u
C. PHP does not support UTF-8 encoded strings
D. A pattern modifier is not needed
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
What is the output of the following code?
class Test {
public function __call($name, $args)
{
call_user_func_array(array('static', "test$name"), $args); }
public function testS($l) {
echo "$l,";
}
}
class Test2 extends Test {
public function testS($l) {
echo "$l,$l,";
}
}
$test = new Test2();
$test->S('A');
A. A,
B. A,A,
C. A,A,A,
D. PHP Warning: call_user_func_array() expects parameter 1 to be a valid callback
Nowadays, the certification exams become more and more important and required by more and more enterprises when applying for a job. But how to prepare for the exam effectively? How to prepare for the exam in a short time with less efforts? How to get a ideal result and how to find the most reliable resources? Here on Vcedump.com, you will find all the answers. Vcedump.com provide not only Zend exam questions, answers and explanations but also complete assistance on your exam preparation and certification application. If you are confused on your 200-710 exam preparations and Zend certification application, do not hesitate to visit our Vcedump.com to find your solutions here.