Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

number_format() changed undocumented behaviour since PHP 8.3.0 #13866

Closed
@langemeijer

Description

Description

https://3v4l.org/ELBNR

The following code:

<?php
echo number_format(3.1415, -1, ".", ",");

Resulted in this output since PHP 8.3.0:

0

But I expected this output instead:

3

No such change has been documented in https://www.php.net/manual/en/function.number-format.php

I understand -1 is not an expected value for $decimals, but if this change is intended I would have expected a E_WARNING or E_DEPRECATED before.

PHP Version

PHP 8.3.0

Operating System

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /