php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #65063 Irrelevant return values in documentation
Submitted: 2013-06-19 12:49 UTC Modified: 2014-12-27 22:14 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: slyoldbear at gmail dot com Assigned: pdezwart (profile)
Status: Closed Package: amqp (PECL)
PHP Version: 5.3.26 OS: linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: slyoldbear at gmail dot com
New email:
PHP Version: OS:

 

 [2013-06-19 12:49 UTC] 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.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-06-24 22:55 UTC] philip@php.net
-Status: Open +Status: Analyzed -Assigned To: +Assigned To: pdezwart
 [2013-06-24 22:55 UTC] philip@php.net
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.
 [2014-12-27 22:14 UTC] sobak@php.net
-Status: Analyzed +Status: Closed
 [2014-12-27 22:14 UTC] sobak@php.net
AMQP documentation is no longer a part of php.net manual.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 02 16:01:37 2025 UTC