File tree Expand file tree Collapse file tree 3 files changed +14
-7
lines changed
Expand file tree Collapse file tree 3 files changed +14
-7
lines changed Original file line number Diff line number Diff line change 77 with a given skeleton, locale, collapse type and identity fallback.
88 (BogdanUngureanu)
99
10+ - Standard:
11+ . Passing 1 or negative base to log() now throws a ValueError.
12+ (alexandre-daubois)
13+
1014<<< NOTE: Insert NEWS from last stable release here prior to actual release! >>>
Original file line number Diff line number Diff line change @@ -667,12 +667,8 @@ PHP_FUNCTION(log)
667667 RETURN_DOUBLE (log10 (num ));
668668 }
669669
670- if (base == 1.0 ) {
671- RETURN_DOUBLE (ZEND_NAN );
672- }
673-
674- if (base <= 0.0 ) {
675- zend_argument_value_error (2 , "must be greater than 0" );
670+ if (base <= 0.0 || base == 1.0 ) {
671+ zend_argument_value_error (2 , "must not be 1 or less than or equal to 0" );
676672 RETURN_THROWS ();
677673 }
678674
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--
14- log(): Argument #2 ($base) must be greater than 0
20+ log(): Argument #2 ($base) must not be 1 or less than or equal to 0
21+ log(): Argument #2 ($base) must not be 1 or less than or equal to 0
You can’t perform that action at this time.
0 commit comments