200-550 200-550

Loading demo links...

Showing 13–15 of 15 questions

Question 13

What is the recommended method of copying data between two opened files?

Select an option, then click Submit answer.

  • copy($source_file, $destination_file);

  • copy($destination_file, $source_file);

  • stream_copy_to_stream($source_file, $destination_file);

  • stream_copy_to_stream($destination_file, $source_file);

  • stream_bucket_prepend($source_file, $destination_file);

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

Select an option, then click Submit answer.

  • 9

  • 6

  • 0

  • 3

Question 15

After performing the following operations:

$a = array('a', 'b', 'c');

$a = array_keys(array_flip($a));

What will be the value of $a?

Select an option, then click Submit answer.

  • array('c', 'b', 'a')

  • array(2, 1, 0)

  • array('a', 'b', 'c')

  • None of the above