Exclusive Black Friday Deal: 70% Off All Exam Bundles! Use coupon code below to unlock your savings! - Ends in 0d 00h 00m 00s - Coupon code: Friday70

Free Zend Certified PHP Engineer Practice Questions

Question # 11

Which of the following is NOT true about PHP traits? (Choose 2)

Options:

A.  

Multiple traits can be used by a single class.

B.  

A trait can implement an interface.

C.  

A trait can declare a private variable.

D.  

Traits are able to be auto-loaded.

E.  

Traits automatically resolve conflicts based on definition order.

Discussion 0
Question # 12

What is the preferred method for preventing SQL injection?

Options:

A.  

Always using prepared statements for all SQL queries.

B.  

Always using the available database-specific escaping functionality on all variables prior to building the SQL query.

C.  

Using addslashes() to escape variables to be used in a query.

D.  

Using htmlspecialchars() and the available database-specific escaping functionality to escape variables to be used in a query.

Discussion 0
Question # 13

What is the method used to execute XPath queries in the SimpleXML extension?

Options:

A.  

xpathQuery()

B.  

xpath()

C.  

simpleXMLXpath()

D.  

query()

E.  

evaluate()

Discussion 0
Question # 14

What is the output of the following code?

class A {

public $a = 1;

public function __construct($a) { $this->a = $a; }

public function mul() {

return function($x) {

return $this->a*$x;

};

}

}

$a = new A(2);

$a->mul = function($x) {

return $x*$x;

};

$m = $a->mul();

echo $m(3);

Options:

A.  

9

B.  

6

C.  

0

D.  

3

Discussion 0
Question # 15

When using password_hash() with the PASSWORD_DEFAULT algorithm constant, which of the following is true? (Choose 2)

Options:

A.  

The algorithm that is used for hashing passwords can change when PHP is upgraded.

B.  

The salt option should always be set to a longer value to account for future algorithm requirements.

C.  

The string length of the returned hash can change over time.

D.  

The hash algorithm that's used will always be compatible with crypt() .

Discussion 0
Question # 16

Which of the following techniques ensures that a value submitted in a form can only be yes or no ?

Options:

A.  

Use a select list that only lets the user choose between yes and no .

B.  

Use a hidden input field that has a value of yes or no .

C.  

Enable the safe_mode configuration directive.

D.  

None of the above.

Discussion 0
Question # 17

What types of HTTP authentication are supported by PHP? (Choose 2)

Options:

A.  

Basic

B.  

Advanced

C.  

Strict

D.  

Digest

E.  

Realm

Discussion 0
Question # 18

How many elements does the array $matches from the following code contain?

$str = "The cat sat on the roof of their house.";

$matches = preg_split("/(the)/i", $str, -1, PREG_SPLIT_DELIM_CAPTURE);

Options:

A.  

2

B.  

3

C.  

4

D.  

7

E.  

9

Discussion 0
Question # 19

Which one of the following XML declarations is NOT valid?

Options:

A.  

B.  

C.  

D.  

Discussion 0
Question # 20

Which of the following may be used in conjunction with CASE inside a SWITCH statement?

Options:

A.  

A scalar

B.  

An expression

C.  

A boolean

D.  

All of the above

Discussion 0

200-550 PDF

200-550 PDF (Printable)
$46.5
$154.99

200-550 Testing Engine

200-550 PDF (Printable)
$51
$169.99

200-550 PDF + Testing Engine

200-550 PDF (Printable)
$63.9
$212.99

Free Exams Sample Questions