Which of the following are NOT acceptable ways to create a secure password hash in PHP? (Choose 2)
A. md5()
B. hash_pbkdf2()
C. password_hash()
D. crypt()
E. openssl_digest()
What is the preferred method for preventing SQL injection?
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.
When using password_hash() with the PASSWORD_DEFAULT algorithm constant, which of the following is true? (Choose 2)
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() .
Which of the following functions will allow identifying unique values inside an array?
A. array_unique_values
B. array_distinct
C. array_count_values
D. array_intersect
E. array_values
What will be the result of the following operation? $a = array_merge([1,2,3] + [4=>1,5,6]); echo $a[2];
A. 4
B. 3
C. 2
D. false
E. Parse error
What is the output of the following code?
class Number {
private $v;
private static $sv = 10;
public function __construct($v) { $this->v = $v; }
public function mul() {
return static function ($x) {
return isset($this) ? $this->v*$x : self::$sv*$x;
};
}
}
$one = new Number(1);
$two = new Number(2);
$double = $two->mul();
$x = Closure::bind($double, null, 'Number');
echo $x(5);
A. 5
B. 10
C. 50
D. Fatal error
Which of the following statements about anonymous functions in PHP are NOT true? (Choose 2)
A. Anonymous functions can be bound to objects
B. Anonymous functions created within object context are always bound to that object
C. Assigning closure to a property of an object binds it to that object
D. Methods bind() and bindTo() of the Closure object provide means to create closures with different binding and scope
E. Binding defines the value of $this and the scope for a closure
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);
A. 9
B. 6
C. 0
D. 3
In the following code, which line should be changed so it outputs the number 2:
class A {
protected $x = array(); /* A */
public function getX() { /* B */
return $this->x; /* C */
}
}
$a = new A(); /* D */
array_push($a->getX(), "one");
array_push($a->getX(), "two");
echo count($a->getX());
A. No changes needed, the code would output 2 as is
B. Line A, to: protected and$x = array();
C. Line B, to: public function andgetX() {
D. Line C, to: return and$this->x;
E. Line D, to: $a =and new A();
Given the following code, how can we use both traits A and B in the same class? (select all that apply)
trait A {
public function hello() {
return "hello";
}
public function world() {
return "world";
}
}
trait B {
public function hello() {
return "Hello";
}
public function person($name) {
return ":$name";
}
}
A. Rename the A::hello() method to a different name using A::hello as helloA;
B. Use B::hello() instead of A 's version using B::hello insteadof A
C. Use B::hello() instead of A 's version using use B::hello
D. Rename the A::hello() method to a different name using A::hello renameto helloA;
E. None of the above (both can be used directly)
Nowadays, the certification exams become more and more important and required by more and more enterprises when applying for a job. But how to prepare for the exam effectively? How to prepare for the exam in a short time with less efforts? How to get a ideal result and how to find the most reliable resources? Here on Vcedump.com, you will find all the answers. Vcedump.com provide not only Zend exam questions, answers and explanations but also complete assistance on your exam preparation and certification application. If you are confused on your 200-550 exam preparations and Zend certification application, do not hesitate to visit our Vcedump.com to find your solutions here.