PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Mail » Mail_Queue » Bug #5708

Syntax incorrect in constructor Mail_Queue::Mail_Queue() example

Details

Request #5708Syntax incorrect in constructor Mail_Queue::Mail_Queue() example
Submitted2005-10-17 19:04 UTC
Fromben at nlcweb dot com
Assignedquipo
StatusClosed
PackageMail_Queue
PHP Version4.3.11
OSAny
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';