| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
| |
For rationale, see https://github.com/php/php-src/pull/6787
Extensions migrated in this part:
* bcmath
* bz2
* calendar
* com_dotnet
* ctype
Closes GH-6797.
|
| |
|
|
|
|
| |
Closes GH-6714
Signed-off-by: George Peter Banyard <girgias@php.net>
|
| |
|
|
|
|
|
|
| |
This converts the remaining "non well-formed" warnings in bcmath
to ValueErrors, in line with the other warning promotions that
have been performed in this extension.
Closes GH-80545.
|
| | |
|
| |
|
|
|
|
|
|
|
| |
We should keep the value of bcmath.scale and the internal
bc_precision global synchronized.
Probably more important than the ability to retrieve bcmath.scale
via ini_get(), this also makes sure that the set scale does not
leak into the next request, as it currently does.
|
| |
|
|
| |
Closes GH-6205.
|
| |
|
|
|
|
| |
Also do a bit of refactoring at the same time.
Closes GH-6105
|
| |
|
|
| |
Closes GH-5958
|
| |
|
|
| |
Closes GH-5747
|
| |
|
|
|
|
|
|
| |
Make sure bcmatch scale is between 0 and INT_MAX, both for the
ini setting, and all the functions accepting a scale argument.
A ValueError is thrown if a function argument is out of range.
Closes GH-5455.
|
| |
|
|
| |
Closes GH-5066 As a first step, let's capitalize their initial letter when it is applicable.
|
| |\
| |
| |
| |
| | |
* PHP-7.4:
Test fixes
|
| | | |
|
| |\ \
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* PHP-7.4:
Fix test
Fix bug #78793
Fix build - no model field anymore
Fixed bug #78910
Fix #78878: Buffer underflow in bc_shift_addsub
Fix test
Fix #78862: link() silently truncates after a null byte on Windows
Fix #78863: DirectoryIterator class silently truncates after a null byte
Fix #78943: mail() may release string with refcount==1 twice
|
| | |\
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
* PHP-7.3:
Fixed bug #78910
Fix #78878: Buffer underflow in bc_shift_addsub
Fix test
Fix #78862: link() silently truncates after a null byte on Windows
Fix #78863: DirectoryIterator class silently truncates after a null byte
Fix #78943: mail() may release string with refcount==1 twice
|
| | | |\
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
* PHP-7.2:
Fixed bug #78910
Fix #78878: Buffer underflow in bc_shift_addsub
Fix test
Fix #78862: link() silently truncates after a null byte on Windows
Fix #78863: DirectoryIterator class silently truncates after a null byte
|
| | | | |
| | | |
| | | |
| | | |
| | | | |
We must not rely on `isdigit()` to detect digits, since we only support
decimal ASCII digits in the following processing.
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines in all
*.phpt sections.
According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.
C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."
Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.
[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
|
| | | | |\
| | | | |
| | | | |
| | | | |
| | | | | |
* PHP-7.1:
Refix the tests once more
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The behavior change seems to be in both runtime and system. The
displaced warning output is of secondary interest anyway.
|
| | | | |\ \
| | | | |/
| | | | |
| | | | |
| | | | | |
* PHP-7.1:
Fix remaining AppVeyor test failures due to the image update
|
| | | | | | |
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines in all
*.phpt sections.
According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.
C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."
Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.
[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Remove most of the `===DONE===` tags and its variations.
Keep `===DONE===` if the test output otherwise becomes empty.
Closes GH-4872.
|
| |/ / / /
| | | |
| | | |
| | | |
| | | |
| | | | |
`bcdiv()` and `bcmod()` throw DivisionByZeroError if the divisor is 0,
which matches the behavior of the `/` and `%` operators, and `bcsqrt()`
throws ValueError for negative operands.
|
| | | | |
| | | |
| | | |
| | | |
| | | | |
Co-Authored-By: Nikita Popov <nikita.ppv@googlemail.com>
Co-Authored-By: Christoph M. Becker <cmbecker69@gmx.de>
|
| | | | |
| | | |
| | | |
| | | |
| | | | |
These tests only check zpp error conditions, so drop them per
zpp testing policy.
|
| |/ / /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines in all
*.phpt sections.
According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.
C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."
Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.
[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
|
| | | |
| | |
| | |
| | | |
EXPECTF logic in run-tests.php is considerable, so let's avoid it.
|
| | | |
| | |
| | |
| | | |
bc_raisemod's mod can't be zero and expo can't be negative
|
| |\ \ \
| |/ /
| | |
| | |
| | | |
* PHP-7.2:
Scale support for bcmod()
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
As of commit 90dcbbe (PHP-7.2+) bcmod() supports non-integral
parameters as well. Since formerly only integer modulus has been
supported, it did not make much sense to cater to the scale with regard
to the result. However, now it does for consistency with other BCMath
operations.
Therefore, we add support for an optional `scale` parameter and fall
back to the default scale (`bcmath.scale`) as usual.
|
| |\ \ \
| | | |
| | | |
| | | |
| | | | |
* pull-request/2742:
Fixed bug #66364 (BCMath bcmul ignores scale parameter)
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
We change `bcmul()` and `bcpow()` so that the result has exactly the
requested scale (i.e. decimal places) to make them consistent with the
other BCMath functions. This also changes our stance regarding bug
#52748, which had been classified as documentation problem.
We do not manipulate the numbers themselves (anymore), but rather
introduce `bc_num2str_ex()` which accepts a scale parameter that
overrides the scale of the number by omitting extraneous decimals and
adding zeros, respectively. This also allows us to get rid of
`split_bc_num()`, which fixes bug #75164 as well.
|
| |\ \ \ \
| | | | |
| | | | |
| | | | |
| | | | | |
* pull-request/2745:
Fixed bug #75169 (BCMath errors/warnings bypass error handling)
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Instead of writing warning messages to `stderr`, we employ PHP's error
handling to raise `E_WARNING` even for the single case where
`bc_rt_error()` has been called, since that did not actually error out.
We choose to call `php_error_docref()` directly in libbcmath, since
there is no upstream, and since other PHP core functionality is already
used in our bundled libbcmath. Accordingly, we remove `rt.c` so it will
not be accidentally used in the future.
Besides adapting a few existing tests, we add new tests so that the
warnings are tested at least once. We also get rid of the Windows
specific tests, since the warning behavior is now supposed to be
platform-agnostic.
|
| |\ \ \ \ \
| |_|_|/ /
|/| | | |
| | | | |
| | | | |
| | | | |
| | | | | |
* pull-request/2739:
Fix proto and indentation
Fix arginfo
Return old scale value from bcscale()
|
| | |\ \ \ \ |
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | | |
Fix for #67855
|
| |\ \ \ \ \ \
| |_|_|/ / /
|/| | | | /
| | |_|_|/
| |/| | | |
* PHP-7.1:
Fixed bug #46781 (BC math handles minus zero incorrectly)
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Actually, there is no negative zero at all. We obey Postel's law, and
still accept negative zeroes, but we store them as positive zeroes
after the conversion from string, i.e. we normalize before further
processing.
|
| |\ \ \ \ \
| |/ / / /
| | | | |
| | | | |
| | | | | |
* PHP-7.1:
Fix bug75178.phpt on Windows
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
bug75178.phpt fails on Windows, because the stderr output is not
interspersed with stdout output there, but rather is appended to the
end. The fix is analogous to bug72093.phpt.
|
| |\ \ \ \ \
| |/ / / /
| | | | /
| |_|_|/
|/| | | |
* PHP-7.1:
Fixed bug #75178 (bcpowmod() misbehaves for non-integer base or modulus)
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Since `bcpowmod()` does not support non-integral operands, we have to
truncate these in addition to emitting a respective warning. We also
have to work with the truncated values in the following.
We recognize that the division by one to enforce the truncation is
actually overkill, but we stick with it for now, and shall tackle the
issue for PHP 7.3.
|
| |\ \ \ \
| |/ / /
| | | |
| | | |
| | | | |
* PHP-7.1:
Fixed bug #54598 (bcpowmod() may return 1 if modulus is 1)
|
| | | | |
| | | |
| | | |
| | | |
| | | | |
`x mod 1` is always zero; we have to take the scale into account,
though.
|
| |\ \ \ \
| |/ / /
| | / /
| |/ /
|/| | |
* PHP-7.1:
Fixed bug #44995 (bcpowmod() fails if scale != 0)
|
| | | |
| | |
| | |
| | |
| | | |
`bc_divmod()` is supposed to do integer division, so we must not apply
a scale factor here.
|
| | | | |
|