Transactions are used to:
What is the output of the following code?
$a = 3;
switch ($a) {
case 1: echo 'one'; break;
case 2: echo 'two'; break;
default: echo 'four'; break;
case 3: echo 'three'; break;
}
How do you allow the caller to submit a variable number of arguments to a function?
What is the name of the method that can be used to provide read access to virtual properties in a class?
You want to parse a URL into its single parts. Which function do you choose?
What function can reverse the order of values in an array without the loss of key information?
Which of the following keywords is not new in PHP 5?
How can a PHP extension be loaded? (Choose 2)
Consider the following code:
strspn($test, 'aeiou', 1);
The variable $test contains the string "You get certified".
What will the function call return?
What will the following code piece print?
echo strtr('Apples and bananas', 'ae', 'ea')
What is the length of a string returned by: md5(rand(), TRUE);
Given the default PHP configuration, how can all of the parameters provided via GET be accessed in a form of a string?
When retrieving data from URLs, what are valid ways to make sure all file_get_contents calls send a certain user agent string? (Choose 2)
How many elements does the $matches array contain after the following function call is performed?
preg_match('/^(\d{1,2}([a-z]+))(?:\s*)\S+ (?=200[0-9])/', '21st March
2006', $matches);
Assuming UTF-8 encoding, what is the value of $count?
What is the difference between "print" and "echo"?
Which function can help prevent cross-site scripting? (Choose 2)
Transitions can be used to: (Choose 2)
Which elements does the array returned by the function pathinfo() contain?
What tags can always be used to begin a PHP script? (Choose 2)
What is the output of the following script?
1 <?php
2 class a
3 {
4 public $val = 10;
5 }
6
7 function renderVal (a $a)
8 {
9 return $a->$val;
10 }
11
12 renderVal (new a);
13 ?>
PHP’s array functions such as array_values() can be used on an object is the oject….
The following form is loaded in a recent browser and submitted, with the second list element selected:
In the server-side PHP code to deal with the form data, what is the value of $_POST ['list']?
A/hen comparing prepared statements and regular, application-constructed SQL statements, which of the following is true?
What is the name of the key pointing to the domain name in the array returned by parse_url()?
You are creating an application that repeatedly connects to a database to retrieve order data for invoices. All data comes from the same database. In order to preserve resources, you have to ensure that only one database connection should be used at any time. The code also has to open as few new database connections as possible. Which design pattern should you use for this scenario?
Is the following code piece E_STRICT compliant?
final class Testing {
var $test = 0;
public function tester() {
return "Tested!";
}}
Which of the following code snippets writes the content of the “source.txt” to “target.txt”?
How can XML parsing errors be suppressed in the SimpleXML extension?
What will the following function call return?
strstr('http://example.com/test/file.php ', '/');
Assume that you are using PHP s session management without cookies and want to make sure that session information does not get lost when redirecting the client to another URL. Which of the following functions do you need to achieve that? (Choose 3)
What is the output of the following code:
str_replace(array("Apple","Orange"), array("Orange","Apple"), "Oranges are orange and Apples are green");
Which of the following may be used in conjunction with CASE inside a SWITCH statement?
How can the constant defined below be accessed from within PHP?
class myClass {
const FOO = 'BAR';
}
Which of the following statements are NOT true?
After running this sort, what will be the value of $b?
$a = array('_!', 'def', 0);
$b = sort($a);
What is the output of the following code?
What does the __FILE__ constant contain?