|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #61888 crypt() should be documented as not binary safe
Submitted: 2012-05-01 13:10 UTC Modified: 2019-01-09 18:06 UTC
Avg. Score:3.5 ± 1.1
Reproduced:3 of 4 (75.0%)
Same Version:3 (100.0%)
Same OS:2 (66.7%)
From: M8R-11ccwk at mailinator dot com Assigned: girgias (profile)
Status: Closed Package: Strings related
PHP Version: Irrelevant 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: M8R-11ccwk at mailinator dot com
New email:
PHP Version: OS:


 [2012-05-01 13:10 UTC] M8R-11ccwk at mailinator dot com

I understand that crypt() must not be binary safe in order to maintain 
compatibility with other implementations, but it should be clearly stated in the 
crypt() documentation, since it might lead to unexpected results (for example, 
when feeding raw bytes directly into crypt()).

Test script:
For example, this two lines generate the same output, which is correct, but can be confusing:

echo crypt("aaa", '$2a$07$usesomesillystringforsalt$');
echo crypt("aaa\x00aa", '$2a$07$usesomesillystringforsalt$');


patch-crypt-not-binary-safe-warning (last revision 2019-01-01 21:01 UTC by

Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-12-01 14:28 UTC]
-Type: Feature/Change Request +Type: Documentation Problem -Package: Documentation problem +Package: Strings related
 [2018-12-31 17:02 UTC]
-Status: Open +Status: Assigned -PHP Version: 5.4.1 +PHP Version: Irrelevant -Assigned To: +Assigned To: girgias
 [2019-01-01 21:01 UTC]
The following patch has been added/updated:

Patch Name: patch-crypt-not-binary-safe-warning
Revision:   1546376474
 [2019-01-09 18:00 UTC]
Automatic comment from SVN on behalf of cmb
Log: Fix #61888: crypt() should be documented as not binary safe
 [2019-01-09 18:06 UTC]
-Status: Assigned +Status: Closed
 [2019-01-09 18:06 UTC]
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.
 [2020-02-07 06:05 UTC]
Automatic comment on behalf of cmb
Log: Fix #61888: crypt() should be documented as not binary safe
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Thu Jun 01 00:03:40 2023 UTC