Summer Special Limited Time 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: exc65

Which of the following statements about PHP is false? (Choose 2)

A.

A final class can be derived.

B.

A final class may be instantiated.

C.

A class with a final function may be derived.

D.

Static functions can be final.

E.

Properties can be final.

You want to allow your users to submit HTML code in a form, which will then be displayed as real code and not affect your page layout. Which function do you apply to the text, when displaying it? (Choose 2)

A.

strip_tags()

B.

htmlentities()

C.

htmltidy()

D.

htmlspecialchars()

E.

showhtml()

What is the output of the following code?

echo "1" + 2 * "0x02";

A.

1

B.

3

C.

5

D.

20

E.

7

Which value will be assigned to the key 0 in this example?

$foo = array(true, '0' => false, false => true);

An object can be counted with count() and sizeof() if it...

A.

implements ArrayAccess

B.

has a public __count() method

C.

was cast to an object from an array

D.

None of the above

Which of the following superglobals does not necessarily contain data from the client?

A.

$_POST

B.

$_SESSION

C.

$_GET

D.

$_SERVER

What is the output of the following code?

function fibonacci (&$x1 = 0, &$x2 = 1)

{

$result = $x1 + $x2;

$x1 = $x2;

$x2 = $result;

return $result;

}

for ($i = 0; $i < 10; $i++) {

echo fibonacci() . ',';

}

A.

An error

B.

1,1,1,1,1,1,1,1,1,1,

C.

1,1,2,3,5,8,13,21,34,55,

D.

Nothing

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();

How should class MyObject be defined for the following code to work properly? Assume $array is an array and MyObject is a user-defined class.

$obj = new MyObject();

array_walk($array, $obj);

A.

MyObject should extend class Closure

B.

MyObject should implement interface Callable

C.

MyObject should implement method __call

D.

MyObject should implement method __invoke

Which of the following statements about exceptions is correct? (Choose 2)

A.

you can only throw classes derived from Exception

B.

a try block can have multiple catch blocks

C.

a try block must not be followed by a catch block

D.

try blocks cannot contain nested try blocks