Doc #77218 [Com]: password_hash returns null

From: Date: Thu, 29 Nov 2018 08:33:25 +0000
Subject: Doc #77218 [Com]: password_hash returns null
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-16182@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=77218&edit=1

 ID:                 77218
 Comment by:         magnar at myrtveit dot com
 Reported by:        magnar at myrtveit dot com
 Summary:            password_hash returns null
 Status:             Open
 Type:               Documentation Problem
 Package:            *Encryption and hash functions
 Operating System:   Any
 PHP Version:        7.3.0RC6
 Block user comment: N
 Private report:     N

 New Comment:

It seems that password_hash returns null on all failures. Here is my test: https://3v4l.org/DMv87


Previous Comments:
------------------------------------------------------------------------
[2018-11-29 08:26:53] magnar at myrtveit dot com

Description:
------------
From manual page: http://php.net/manual/en/function.password-hash.php

The return value is documented as "Returns the hashed password, or FALSE on failure."
However, password_hash returns null on failure, as is evident from this test: https://3v4l.org/siaNi I am not sure whether password_hash returns
false on other failures.

I don't know whether the issue is with the documentation or with the function.

Test script:
---------------
var_dump(password_hash('foo', -1));

Expected result:
----------------
false (based on the documentation)

Actual result:
--------------
null


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=77218&edit=1


Thread (10 messages)

« previous php.doc.bugs (#16182) next »