Skip to content

Commit a189b2c

Browse files
committed
Fix object support for frameless clamp function
1 parent 90ab306 commit a189b2c

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

ext/standard/math.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -451,14 +451,14 @@ ZEND_FRAMELESS_FUNCTION(clamp, 3)
451451
}
452452

453453
if (zend_compare(zmax, zvalue) == -1) {
454-
RETURN_COPY_VALUE(zmax);
454+
RETURN_COPY(zmax);
455455
}
456456

457457
if (zend_compare(zvalue, zmin) == -1) {
458-
RETURN_COPY_VALUE(zmin);
458+
RETURN_COPY(zmin);
459459
}
460460

461-
RETURN_COPY_VALUE(zvalue);
461+
RETURN_COPY(zvalue);
462462
}
463463
/* }}} */
464464

ext/standard/tests/math/clamp.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ float(2.5)
4949
float(2.5)
5050
float(1.3)
5151
float(3.141592653589793)
52-
double(NAN)
52+
float(NAN)
5353
string(1) "c"
5454
string(1) "d"
5555
2025-08-15
5656
2025-08-20
5757
2025-08-15
5858
2025-08-20
59-
Argument #2 ($min) cannot be NAN
60-
Argument #3 ($max) cannot be NAN
61-
Argument #2 ($min) must be smaller than or equal to argument #3 ($max)
59+
clamp(): Argument #2 ($min) cannot be NAN
60+
clamp(): Argument #3 ($max) cannot be NAN
61+
clamp(): Argument #2 ($min) must be smaller than or equal to argument #3 ($max)

0 commit comments

Comments
 (0)