nerdexam
Zend

ZF-100-500 · Question #104

Consider the following code segment: 1. <?php 2. require_once 'Zend/Mail.php'; 3. ????????????????????????? 4. $mail->setBodyText('This is the test email.'); 5…

The correct answer is B. $mail = new Zend_Mail(). See the full explanation below for the reasoning.

Question

Consider the following code segment: 1. <?php 2. require_once 'Zend/Mail.php'; 3. ????????????????????????? 4. $mail->setBodyText('This is the test email.'); 5. $mail->setFrom('[email protected]', 'Sender'); 6. $mail->addTo('[email protected]', 'Recipient'); 7. $mail->setSubject('TestSubject'); 8. $mail->send(); 9. ?> Which of the following code snippets will you use at line number 3 to initiate Zend_Mail?

Options

  • A$mail => Zend_Mail();
  • B$mail = new Zend_Mail();
  • C$mail => initialize_Zend_Mail();
  • D$mail -> Zend_Mail();

How the community answered

(43 responses)
  • A
    9% (4)
  • B
    84% (36)
  • C
    2% (1)
  • D
    5% (2)

Community Discussion

No community discussion yet for this question.

Full ZF-100-500 Practice