Doc #79530 [Opn->Csd]: bcpowmod never returns NULL as stated in doc
| From: | cmb@php.net | Date: | Tue, 28 Apr 2020 11:33:58 +0000 |
| Subject: | Doc #79530 [Opn->Csd]: bcpowmod never returns NULL as stated in doc | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-17527@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=79530&edit=1
ID: 79530
Updated by: cmb@php.net
Reported by: mail at einargangso dot no
Summary: bcpowmod never returns NULL as stated in doc
-Status: Open
+Status: Closed
Type: Documentation Problem
Package: Documentation problem
PHP Version: Irrelevant
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2020-04-28 11:33:37] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&revision=349720
Log: Fix #79530: bcpowmod never returns NULL as stated in doc
------------------------------------------------------------------------
[2020-04-27 17:01:53] mail at einargangso dot no
Description:
------------
---
From manual page: https://www.php.net/manual/en/function.bcpowmod.php
---
> Returns the result as a string, or NULL if modulus is 0 or exponent is negative.
It never returns NULL, but false.
https://3v4l.org/co5Ge
Source: https://github.com/php/php-src/blob/master/ext/bcmath/bcmath.c#L365
Test script:
---------------
<?php
// modulus is 0
assert(is_bool(bcpowmod('2', '2', '0'))); // bcpowmod -> FALSE
// exponent is negative
assert(is_bool(bcpowmod('2', '-2', '2'))); // bcpowmod -> FALSE
// Output proof
var_dump(false === bcpowmod('2', '2', '0') && false ===
bcpowmod('2', '2', '0'));
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=79530&edit=1