|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #80440 base_convert doesn't take named arguments
Submitted: 2020-11-28 23:16 UTC Modified: 2020-12-28 14:20 UTC
From: zevio at dougherty dot se Assigned: cmb (profile)
Status: Closed Package: *Math Functions
PHP Version: 8.0.0 OS: Mac OS 11.0.1
Private report: No CVE-ID: None
 [2020-11-28 23:16 UTC] zevio at dougherty dot se
Named arguments do not work with base_convert.

base_convert(number: 'a37334', frombase: 16, tobase: 2) throws error.

Test script:
<?php declare(strict_types = 1);

echo base_convert(number: 'a37334', frombase: 16, tobase: 2);

Expected result:

Actual result:
PHP Fatal error:  Uncaught Error: Unknown named parameter $number in…


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-11-28 23:53 UTC]
Oh, they do: <>.  However, the documentation
is not yet up to date regarding the parameters names; we're
working on that[1].  For the time being, consider to use
reflection to retrieve the proper parameters, e.g.

    php --rf base_convert

[1] <>
 [2020-11-28 23:54 UTC]
-Type: Bug +Type: Documentation Problem
 [2020-12-28 14:20 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2020-12-28 14:20 UTC]
The documentation has been updated in the meantime.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 01:01:28 2024 UTC