Skip to content

Commit 9c9f49a

Browse files
committed
Merge branch 'PHP-8.2' into PHP-8.3
2 parents 6bb6ff2 + 0a8fbef commit 9c9f49a

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

configure.ac

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,9 @@ case $host_cpu in
220220
;;
221221
esac
222222

223+
dnl See https://github.com/php/php-src/issues/14140
224+
AX_CHECK_COMPILE_FLAG([-ffp-contract=off], [CFLAGS="$CFLAGS -ffp-contract=off"])
225+
223226
dnl Mark symbols hidden by default if the compiler (for example, gcc >= 4)
224227
dnl supports it. This can help reduce the binary size and startup time.
225228
AX_CHECK_COMPILE_FLAG([-fvisibility=hidden],

ext/standard/tests/array/gh14140.phpt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
--TEST--
2+
GH-14140: Floating point bug in range operation on Apple Silicon hardware
3+
--FILE--
4+
<?php
5+
/*
6+
* This is a problem that occurs not only in Apple silicon, but also in the Arm
7+
* processor environment in general, which uses clang as the compiler.
8+
*/
9+
print_r(range(-0.03, 0.03, 0.01));
10+
?>
11+
--EXPECT--
12+
Array
13+
(
14+
[0] => -0.03
15+
[1] => -0.02
16+
[2] => -0.01
17+
[3] => 0
18+
[4] => 0.01
19+
[5] => 0.02
20+
[6] => 0.03
21+
)

0 commit comments

Comments
 (0)