|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33080 Bug 31465 recurring on 5.0.4
Submitted: 2005-05-20 15:07 UTC Modified: 2005-05-27 04:03 UTC
From: marc at durdin dot net Assigned: iliaa (profile)
Status: Closed Package: Strings related
PHP Version: 5.0.4 OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: marc at durdin dot net
New email:
PHP Version: OS:


 [2005-05-20 15:07 UTC] marc at durdin dot net
Bug 31465 has been marked as fixed in 5.0.4 - however, I just upgraded to 5.0.4 and started experiencing it on my system - using it to upload files as follows:

I am using the stock precompiled download from

Basic PHP information:

PHP Version => 5.0.4

System => Windows NT 5.2 build 3790
Build Date => Mar 31 2005 02:44:34
Configure Command => cscript /nologo configure.js  "--enable-snapshot-build" "--with-gd=shared"
Server API => Command Line Interface
Virtual Directory Support => enabled
Configuration File (php.ini) Path => [obscured]
PHP API => 20031224
PHP Extension => 20041030
Zend Extension => 220040412
Debug Build => no
Thread Safety => enabled
IPv6 Support => enabled
Registered PHP Streams => php, file, http, ftp, compress.zlib
Registered Stream Socket Transports => tcp, udp

Marc Durdin

Reproduce code:
      $datastring = file_get_contents($Filename);
      $data = unpack("H*hex", $datastring);
      $FileID = mssql_db_call_to_store_file($OriginalFileName, '0x'.$data['hex']);

Expected result:
(no output expected)

Actual result:
Warning: unpack() function.unpack: Type H: outside of string


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-05-20 16:27 UTC]
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try to avoid embedding huge scripts into the report.

 [2005-05-25 12:54 UTC] marc at durdin dot net
Managed to get a script that will do it every time (seems that it raises a E_WARNING). Again, doesn't generate the warning on 5.0.2, does on 5.0.4.

  unpack("H*hex", 'abc');

  function err_handler($errno, $errstr, $errfile, $errline, $vars)
    echo $errno . ": " . $errstr;
 [2005-05-26 00:59 UTC]
Works fine with HEAD, PHP_5_0 buggy..Ilia, you claimed to have fixed this?
 [2005-05-27 04:03 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Aug 05 09:01:23 2021 UTC