Free 200-550 Exam Braindumps
Zend Certified PHP Engineer Questions 101–105 (page: 22)

Updated On: 9-Feb-2026

What is the output of the following code?
var_dump(boolval([]));

  1. bool(true)
  2. bool(false)

Answer(s): B



What is the output of the following code?
var_dump(boolval(new StdClass()));

  1. bool(true)
  2. bool(false)

Answer(s): A



CORRECT TEXT
Consider the following code:

$result = $value1 ??? $value2;
Which operator needs to be used instead of ??? so that $result equals $value1 if $value1 evaluates to true, and equals $value2 otherwise? Just state the operator as it would be required in the code.

  1. ?:

Answer(s): A



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

  1. Multiple traits can be used by a single class.
  2. A trait can implement an interface.
  3. A trait can declare a private variable.
  4. Traits are able to be auto-loaded.
  5. Traits automatically resolve conflicts based on definition order.

Answer(s): B,E



Given the following code, what will the output be:
trait MyTrait {
private $abc = 1;
public function increment() {
$this->abc++;
}
public function getValue() {
return $this->abc;
}
}
class MyClass {
use MyTrait;
public function incrementBy2() {
$this->increment();
$this->abc++;
}
}
$c = new MyClass;
$c->incrementBy2();
var_dump($c->getValue());

  1. Fatal error: Access to private variable MyTrait::$abc from context MyClass
  2. Notice: Undefined property MyClass::$abc
  3. int(2)
  4. int(3)
  5. NULL

Answer(s): D



Viewing page 22 of 46
Viewing questions 106 - 110 out of 223 questions


Post your Comments and Discuss Zend 200-550 exam prep with other Community members:

AI Tutor AI Tutor 👋 I’m here to help!