Doc #64832 [NEW]: use of "lowest" in `$desiredmsgtype` parameter description creates ambiguity
| From: | ww dot galen at gmail dot com | Date: | Mon, 13 May 2013 19:29:00 +0000 |
| Subject: | Doc #64832 [NEW]: use of "lowest" in `$desiredmsgtype` parameter description creates ambiguity | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-9812@lists.php.net to get a copy of this message | ||
From: ww dot galen at gmail dot com
Operating system: n/a
PHP version: Irrelevant
Package: Documentation problem
Bug Type: Documentation Problem
Bug description:use of "lowest" in
$desiredmsgtype parameter description
creates ambiguity
Description:
------------
---
From manual page:
http://www.php.net/function.msg-receive#refsect1-function.msg-receive-parameters
---
In the description of the "$desiredmsgtype" parameter, the use of "lowest"
is confusing:
"If desiredmsgtype is less than 0, the first message on the queue with
the lowest type less than or equal to the
absolute value of desiredmsgtype will be read."
"first [...] with the lowest type" could be interpreted to mean that a
later message with lower type will be picked over
an earlier message with higher type. For example, suppose the queue
contains the following messages (and types):
"2.1" (2), "1.1" (1), "2.2" (2), "1.2" (1)
The lowest type is 1, and the first of these messages is 1.1. However, the
actual result will be "2.1".
Simply dropping the unneeded "the lowest" will clear things up:
"If desiredmsgtype is less than 0, the first message on the queue with
type less than or equal to the absolute value
of desiredmsgtype will be read."
Test script:
---------------
<?php
$q = msg_get_queue(0xF00BAA);
msg_send($q, 2, "2.1");
msg_send($q, 1, "1.1");
msg_send($q, 2, "2.2");
msg_send($q, 1, "1.2");
msg_receive($q, -2, $type, strlen(serialize('0.0')), $msg);
echo "msg for -2: $msg ($type)\n";
msg_remove_queue($q);
Expected result:
----------------
msg for -2: 1.1 (1)
Actual result:
--------------
msg for -2: 2.1 (2)
--
Edit bug report at https://bugs.php.net/bug.php?id=64832&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=64832&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=64832&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=64832&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=64832&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=64832&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=64832&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=64832&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=64832&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=64832&r=support
Expected behavior: https://bugs.php.net/fix.php?id=64832&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=64832&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=64832&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=64832&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64832&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=64832&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=64832&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=64832&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=64832&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=64832&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=64832&r=mysqlcfg