Which of the following is true about stream contexts? (Choose 2)
Show answer and explanation
Correct answers: A, C
200-710 Real Exam Questions
233 questions available · Page 1 of 24
Updated Exam DumpsVerified AnswersPass Guarantee
Which of the following is true about stream contexts? (Choose 2)
Correct answers: A, C
You want to parse a URL into its single parts.
Which function do you choose?
Correct answer: A
What is "instanceof" an example of?
Correct answer: B
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());
Correct answer: D
Consider the following code. What change must be made to the class for the code to work as written?
class Magic {
protected $v = array("a" => 1, "b" => 2, "c" => 3);
public function __get($v) {
return $this->v[$v];
}
}
$m = new Magic();
$m->d[] = 4;
echo $m->d[0];
Correct answer: D
Which of the following techniques ensures that a value submitted in a form can only be yes or no ?
Correct answer: D
FILL BLANK
What is the output of the following code?

Accepted answer: 5
Given a PHP value, which sample shows how to convert the value to JSON?
Correct answer: A
What function is best suited for extracting data from a formatted string into an array?
Correct answer: C
FILL BLANK
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.
Accepted answer: ?: