Doc #65063 [Opn->Ana]: Irrelevant return values in documentation
| From: | philip@php.net | Date: | Mon, 24 Jun 2013 22:55:37 +0000 |
| Subject: | Doc #65063 [Opn->Ana]: Irrelevant return values in documentation | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-9977@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=65063&edit=1
ID: 65063
Updated by: philip@php.net
Reported by: slyoldbear at gmail dot com
Summary: Irrelevant return values in documentation
-Status: Open
+Status: Analyzed
Type: Documentation Problem
Package: amqp
Operating System: linux
PHP Version: 5.3.26
-Assigned To:
+Assigned To: pdezwart
Block user comment: N
Private report: N
New Comment:
The docs should mention NULL is returned if string $queue_name length is less than
1 or greater than 255 because the check is explicit, see:
http://lxr.php.net/xref/PECL/amqp/amqp_queue.c#463
As for exceptions, those should also be documented. This might offer a clue:
http://lxr.php.net/xref/PECL/amqp/php_amqp.h#199
Assigning to Pieter de Zwart (pdezwart) as he is the expert.
Previous Comments:
------------------------------------------------------------------------
[2013-06-19 12:49:32] slyoldbear at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/amqpqueue.setname
---
In the AMQPQueue::setName() page, it's said the return value is:
Returns TRUE on success or FALSE on failure.
however when I set a valid queue name, the return is NULL, and when I set an
invalid one, I've got an: PHP Fatal error: Uncaught exception
'AMQPQueueException'
with message 'Invalid queue name given, must be between 1 and 255 characters long.
Test script:
---------------
// ... here is all stuff regarding the AMQP Connection and Channel
$q = new AMQPQueue($chan);
// example #1 - 3 chars queue name
$a = $q->setName('foo');
// prints NULL
var_dump($a);
// example #2 - 258 chars queue name
$a =
$q->setName('foofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoo');
// Exception thrown
// PHP Fatal error: Uncaught exception 'AMQPQueueException' with message 'Invalid
queue name given, must be between 1 and 255 characters long.
Expected result:
----------------
TRUE in the first example and FALSE in the second one, as mentionned in the
documentation.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=65063&edit=1