Fw: [PHP-DOC] #30033 [Bgs->Opn]: unpack('n') never returns negative values
| From: | Nuno Lopes | Date: | Thu, 09 Sep 2004 09:42:35 +0000 |
| Subject: | Fw: [PHP-DOC] #30033 [Bgs->Opn]: unpack('n') never returns negative values | ||
| Groups: | php.doc.fr | ||
| Request: | Send a blank email to doc-fr+get-3461@lists.php.net to get a copy of this message | ||
It seems you have a little error in the translation of pack()
Nuno
----- Original Message -----
ID: 30033User updated by: jsgoupil at lookstrike dot comReported By: jsgoupil at lookstrike dot com -Status: Bogus +Status: Open -Bug Type: Scripting Engine problem +Bug Type: Documentation problemOperating System: WinXP - LinuxPHP Version: 5.0.1New Comment: OMG, i saw your message and I was angry ! but i check and in French it is written "entier court signé" so it means "signed short" It means that there is a doc error. Previous Comments: ------------------------------------------------------------------------ [2004-09-09 08:04:34] derick@php.net Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Thank you for your interest in PHP. http://php.net/pack: n unsigned short (always 16 bit, big endian byte order) ------------------------------------------------------------------------ [2004-09-09 06:21:40] jsgoupil at lookstrike dot com Description: ------------ With the following code, i receive the max positive value. Same error in PHP4.3.7. Reproduce code: --------------- <?php $val = -1; $val2 = pack('n',$val); $val3 = unpack('nint',$val2); echo $val3['int']; ?> Expected result: ---------------- -1 Actual result: -------------- 65535