Home » Mail » Mail_Queue » Bug #5708
Syntax incorrect in constructor Mail_Queue::Mail_Queue() example
Details
| Request #5708 | Syntax incorrect in constructor Mail_Queue::Mail_Queue() example |
|---|---|
| Submitted | 2005-10-17 19:04 UTC |
| From | ben at nlcweb dot com |
| Assigned | quipo |
| Status | Closed |
| Package | Mail_Queue |
| PHP Version | 4.3.11 |
| OS | Any |
| Roadmaps | (Not assigned) |
Comments
[2005-10-17 19:04 UTC] ben at nlcweb dot com
Description:
------------
I noticed a mistake in the documention for Mail::Queue. From what I can tell, this is really the only place I can report an issue like this. The syntax for one of the examples in the documentation is backwards.
constructor Mail_Queue::Mail_Queue()
Example 45-1.
## ---FIND---
$from_params = empty($from_name) ? '"'.$from_name.'" <'.$from.'>' : '<'.$from.'>';
$recipient_params = empty($recipient_name) ? '"'.$recipient_name.'" <'.$recipient.'>' : '<'.$recipient.'>';
## ---REPLACE---
$from_params = empty($from_name) ? '<'.$from.'>' : '"'.$from_name.'" <'.$from.'>';
$recipient_params = empty($recipient_name) ? '<'.$recipient.'>' : '"'.$recipient_name.'" <'.$recipient.'>';
The syntax of the ternary operator (?) is:
(condition) ? 'true' : 'false';