What is the purpose of the 4th argument to the file_get_contents() function?
Which of the following statements is correct?
What is the output of the following code: echo "1" + 2 * "0x02";
What is the result of the following bitwise operation in PHP?
1 ^ 2
PHP's array functions such as array_values() and array_key_exists() can be used on an object if the object...
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 ?>
The XML document below has been parsed into $xml via SimpleXML. How can the value of
accessed?
How many times will the function counter() be executed in the following code?
function counter($start, &$stop)
{
if ($stop > $start)
{
return;
} counter($start--, ++$stop);
}
$start = 5;
$stop = 2;
counter($start, $stop);
What piece of code would you use to obtain an array of response headers for a given URL, indexed by their respective names?
What does the chown() function do?
When you need to process the values of columns in a database, you should:
How can you determine if magic_quotes_gpc is enabled? (Choose 2)
Which of the following statements are correct? (Choose 2)
After performing the following operations:
$a = array('a', 'b', 'c');
$a = array_keys(array_flip($a));
What will be the value of $a?
You want to access the 3rd character of a string, contained in the variable $test. Which of the following possibilities work?(Choose 2)
Which of the following is NOT possible using reflection?
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?
Which of the following statements about PHP is true? (Choose 3)
Transactions are used to:
Which of the following functions are used to escape data within the context of HTML?
(Choose 2)
How do you allow the caller to submit a variable number of arguments to a function?
How to read a single line, no matter how long from an file opened in the example below?
$fp = fopen("my_file.txt", "w");
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 ?>
What is the output of the following code?
1
2 function append($str)
3 {
4 $str = $str.'append';
5 }
6
7 function prepend(&$str)
8 {
9 $str = 'prepend'.$str;
10 }
11
12 $string = 'zce';
13 append(prepend($string));
14 echo $string;
15 ?>
What is the output of the following code?
printf('%4$d %2$s sit on 2 trees and eat %3$3.2f %1$s', "bananas",
"monkeys", 9, 99);
What function is ideal for outputting contents of a static file to screen?
Which of the following is correct? (Choose 2)
1) A class can extend more than one class.
2) A class can implement more than one class.
3) A class can extend more than one interface.
4) A class can implement more than one interface.
5) An interface can extend more than one interface.
6) An interface can implement more than one interface.
What function is used to retrieve all available information about a symbolic link?
What is the output of the following code?
str_pad('PHP', 10, 'P', STR_PAD_BOTH);
What function can reverse the order of values in an array without the loss of key information?
Given a JSON-encoded string, which code sample correctly indicates how to decode the string to native PHP values?
Which is the most secure approach for handling dynamic data in SQL queries?
Which SPL class implements fixed-size storage?
Which technique should be used to speed up joins without changing their results?
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);
What is the output of the following code?
$a = 'a'; $b = 'b';
echo isset($c) ? $a.$b.$c : ($c = 'c').'d';
Which of the following code snippets is correct? (Choose 2)
a)
interface Drawable {
abstract function draw();
}
b)
interface Point {
function getX();
function getY();
}
c)
interface Line extends Point {
function getX2();
function getY2();
}
d)
interface Circle implements Point {
function getRadius();
}
What method can be used to find a tag with the name "foo" via the DOM extension?