File tree Expand file tree Collapse file tree 3 files changed +11
-1
lines changed
Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -142,6 +142,8 @@ PHP 8.5 UPGRADE NOTES
142142 . Using a printf-family function with a formatter that did not specify the
143143 precision previously incorrectly reset the precision instead of treating
144144 it as a precision of 0. See GH-18897.
145+ . Passing 1 as the second argument to log() now throws a ValueError.
146+ Previously, it returned NaN.
145147
146148========================================
1471492. New Features
Original file line number Diff line number Diff line change @@ -668,7 +668,8 @@ PHP_FUNCTION(log)
668668 }
669669
670670 if (base == 1.0 ) {
671- RETURN_DOUBLE (ZEND_NAN );
671+ zend_argument_value_error (2 , "must not be 1" );
672+ RETURN_THROWS ();
672673 }
673674
674675 if (base <= 0.0 ) {
Original file line number Diff line number Diff line change 99} catch (ValueError $ exception ) {
1010 echo $ exception ->getMessage () . "\n" ;
1111}
12+
13+ try {
14+ log (36 , 1 );
15+ } catch (ValueError $ exception ) {
16+ echo $ exception ->getMessage () . "\n" ;
17+ }
1218?>
1319--EXPECT--
1420log(): Argument #2 ($base) must be greater than 0
21+ log(): Argument #2 ($base) must not be 1
You can’t perform that action at this time.
0 commit comments