Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is PHP_ROUND_TOWARD_ZERO Supposed to Exist in Php8.4? #16701

Closed
oleibman opened this issue Nov 4, 2024 · 6 comments
Closed

Is PHP_ROUND_TOWARD_ZERO Supposed to Exist in Php8.4? #16701

oleibman opened this issue Nov 4, 2024 · 6 comments

Comments

@oleibman
Copy link

oleibman commented Nov 4, 2024

Description

According to https://wiki.php.net/rfc/new_rounding_modes_to_round_function, it should. It doesn't seem to be present in a nightly upload of Php8.4. For now, I just need to know if it has a new name, or if it has been decided not to proceed with this change in Php 8.4, or if there's just something wrong with the version I'm using.

The following code:

<?php
echo PHP_ROUND_TOWARD_ZERO, "\n";

Resulted in this output:

Error: Undefined constant "PHP_ROUND_TOWARD_ZERO" in Command line code on line 1

But I expected this output instead:

Something other than an error message.

PHP Version

PHP 8.4 nightly

Operating System

Windows 11

@oleibman
Copy link
Author

oleibman commented Nov 4, 2024

Same result with:

PHP 8.4.0RC3 (cli) (built: Oct 22 2024 18:11:40) (ZTS Visual C++ 2022 x64)
Copyright (c) The PHP Group
Zend Engine v4.4.0RC3, Copyright (c) Zend Technologies

@iluuu1994
Copy link
Member

There was a follow-up RFC to turn the constants into an enum:
https://wiki.php.net/rfc/correctly_name_the_rounding_mode_and_make_it_an_enum

@nielsdos
Copy link
Member

nielsdos commented Nov 4, 2024

This is the second time this is asked. Perhaps the original RFC text should include a small snippet to refer when/where this was changed.

@iluuu1994
Copy link
Member

iluuu1994 commented Nov 4, 2024

Done.

image

@iluuu1994 iluuu1994 closed this as not planned Won't fix, can't repro, duplicate, stale Nov 4, 2024
@oleibman
Copy link
Author

oleibman commented Nov 4, 2024

Thank you for showing me how to move forward.

@TimWolla
Copy link
Member

TimWolla commented Nov 5, 2024

This is the second time this is asked.

For reference, first time apparently was #16446.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants