What is the output of the following code?
$first = "second";
$second = "first";
echo $$$first;
You work for a shared hosting provider, and your supervisor asks you to disable user scripts to dynamically load PHP extensions using the dl() function. How can you do this? (Choose 2)
Which technique should be used to speed up joins without changing their results?
What happens if you try to access a property whose name is defined in a parent class as private, and is not declared in the current class?
When uploading a file to a PHP script using the HTTP PUT method, where would the information about this file be available?
When comparing prepared statements and regular, application-constructed SQL statements, which of the following is true?
Would the following code catch a parse error?
try {
echo $label
} catch (Exception $e) {
echo $e->getMessage();
}
One common security risk is exposing error messages directly in the browser. Which PHP configuration directive can be disabled to prevent this?
What is the output of the following code?
echo 0x33, ' monkeys sit on ', 011, ' trees.';
What is the content of $c after the following code has executed?
$a = 2;
$b = 3;
$c = ($a++ * ++$b);
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);
What is the output of the following script?
1
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 ?>
When working with the MVC paradigma, the business logic should be implemented in which of the following components?
In the following code, which class can be instantiated?
1
2 abstract class Graphics {
3 abstract function draw($im, $col);
4 }
5
6 abstract class Point1 extends Graphics {
7 public $x, $y;
8 function __construct($x, $y) {
9 $this->x = $x;
10 $this->y = $y;
11 }
12 function draw($im, $col) {
13 ImageSetPixel($im, $this->x, $this->y, $col);
14 }
15 }
16
17 class Point2 extends Point1 { }
18
19 abstract class Point3 extends Point2 { }
20 ?>
Given the following array:
$a = array(28, 15, 77, 43);
Which function will remove the value 28 from $a?
Which of the following parts must a XML document have in order to be well-formed?
PHP's array functions such as array_values() and array_key_exists() can be used on an object if the object...
The following form is loaded in a browser and submitted, with the checkbox activated:
What is the return value of the following code?
strpos("me myself and I", "m", 2)
Which parts of the text are matched in the following regular expression?
1
2 $text = << 3 The big bang bonged under the bung. 4 EOT; 5 6 preg_match_all('@b.n?g@', $text, $matches); 7 ?>
What is the error in the following declaration of a static class method?
1
2 class car {
3 static $speeds = array(
4 'fast',
5 'slow',
6 'medium',
7 );
8
9 static function getSpeeds()
10 {
11 return $this->speeds;
12 }
13 }
14 ?>
When checking whether two English words are pronounced alike, which function should be used for the best possible result?
Given the default PHP configuration, how can all of the parameters provided via GET be accessed in a form of a string?
When PHP is running on a command line, what super-global will contain the command line arguments specified?
What piece of code would you use to obtain an array of response headers for a given URL, indexed by their respective names?
You want to present the following formatted number: "999.000.000,00". Which function call is correct?
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?
How many elements does the array $matches from the following code contain?
1
2 $str = "The cat sat on the roof of their house.";
3
4 $matches = preg_split("/(the)/i", $str, -1,
PREG_SPLIT_DELIM_CAPTURE);
5 ?>
How to read a single line, no matter how long from an file opened in the example below?
$fp = fopen("my_file.txt", "w");
In a shared hosting environment, session data can be read by PHP scripts written by any user. How can you prevent this?
Which of the following functions are used to escape data within the context of HTML?
(Choose 2)
What will the following code print?
echo addslashes('I am a small "HTML" string, which is
\'invalid\'.');
Which is the most efficient way to determine if a key is present in an array,assuming the array has no NULL values?
What will the following code piece print?
echo strtr('Apples and bananas', 'ae', 'ea')
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)
Which of these protocols are NOT governed by the W3C in their latest versions? (Choose 2)