php.net |  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
Description:
------------
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:
----------------
101000110111001100110100

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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-11-28 23:53 UTC] cmb@php.net
Oh, they do: <https://3v4l.org/VgaFY>.  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] <https://github.com/php/doc-en/pulls?q=is%3Apr+is%3Aopen+label%3Amethodsynopses>
 [2020-11-28 23:54 UTC] cmb@php.net
-Type: Bug +Type: Documentation Problem
 [2020-12-28 14:20 UTC] cmb@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2020-12-28 14:20 UTC] cmb@php.net
The documentation has been updated in the meantime.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Fri Oct 22 10:03:33 2021 UTC