200-550

200-550 practice questions, page 3 of 9, with answer review and explanations.

Question 11

What is the output of the following code? echo "22" + "0.2", 23 . 1;

  1. 220.2231
  2. 22.2231
  3. 22.2,231
  4. 56.2

Question 12

What is the output of the following code? $first = "second"; $second = "first"; echo $$first;

  1. "first"
  2. "second"
  3. an empty string
  4. an error

Question 13

SIMULATION - Your supervisor wants you to disallow PHP scripts to open remote HTTP and FTP resources using PHP's file functions. Which php.ini setting should you change accordingly?

Question 14

Which of the following code snippets DO NOT write the exact content of the file "source.txt" to "target.txt"? (Choose 2)

  1. file_put_contents("target.txt", fopen("source.txt", "r"));
  2. file_put_contents("target.txt", readfile("source.txt"));
  3. file_put_contents("target.txt", join(file("source.txt"), "\n"));
  4. file_put_contents("target.txt", file_get_contents("source.txt"));
  5. $handle = fopen("target.txt", "w+"); fwrite($handle, file_get_contents("source.txt")); fclose($handle);

Question 15

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

  1. copy($source_file, $destination_file);
  2. copy($destination_file, $source_file);
  3. stream_copy_to_stream($source_file, $destination_file);
  4. stream_copy_to_stream($destination_file, $source_file);
  5. stream_bucket_prepend($source_file, $destination_file);