summaryrefslogtreecommitdiff
path: root/ext/bcmath
diff options
context:
space:
mode:
Diffstat (limited to 'ext/bcmath')
-rw-r--r--ext/bcmath/bcmath.c29
-rw-r--r--ext/bcmath/config.m48
-rw-r--r--ext/bcmath/libbcmath/AUTHORS1
-rw-r--r--ext/bcmath/libbcmath/ChangeLog9
-rw-r--r--ext/bcmath/libbcmath/FAQ20
-rw-r--r--ext/bcmath/libbcmath/LICENSE (renamed from ext/bcmath/libbcmath/COPYING.LIB)18
-rw-r--r--ext/bcmath/libbcmath/NEWS3
-rw-r--r--ext/bcmath/libbcmath/README9
-rw-r--r--ext/bcmath/libbcmath/README.md45
-rw-r--r--ext/bcmath/libbcmath/src/add.c3
-rw-r--r--ext/bcmath/libbcmath/src/bcmath.h4
-rw-r--r--ext/bcmath/libbcmath/src/compare.c3
-rw-r--r--ext/bcmath/libbcmath/src/debug.c3
-rw-r--r--ext/bcmath/libbcmath/src/div.c3
-rw-r--r--ext/bcmath/libbcmath/src/divmod.c3
-rw-r--r--ext/bcmath/libbcmath/src/doaddsub.c3
-rw-r--r--ext/bcmath/libbcmath/src/init.c3
-rw-r--r--ext/bcmath/libbcmath/src/int2num.c3
-rw-r--r--ext/bcmath/libbcmath/src/nearzero.c3
-rw-r--r--ext/bcmath/libbcmath/src/neg.c3
-rw-r--r--ext/bcmath/libbcmath/src/num2long.c3
-rw-r--r--ext/bcmath/libbcmath/src/num2str.c5
-rw-r--r--ext/bcmath/libbcmath/src/outofmem.c3
-rw-r--r--ext/bcmath/libbcmath/src/output.c3
-rw-r--r--ext/bcmath/libbcmath/src/private.h2
-rw-r--r--ext/bcmath/libbcmath/src/raise.c3
-rw-r--r--ext/bcmath/libbcmath/src/raisemod.c4
-rw-r--r--ext/bcmath/libbcmath/src/recmul.c2
-rw-r--r--ext/bcmath/libbcmath/src/rmzero.c3
-rw-r--r--ext/bcmath/libbcmath/src/sqrt.c3
-rw-r--r--ext/bcmath/libbcmath/src/str2num.c9
-rw-r--r--ext/bcmath/libbcmath/src/sub.c3
-rw-r--r--ext/bcmath/libbcmath/src/zero.c3
-rw-r--r--ext/bcmath/php_bcmath.h2
-rw-r--r--ext/bcmath/tests/bcadd_error1.phpt12
-rw-r--r--ext/bcmath/tests/bcdiv_error2.phpt13
-rw-r--r--ext/bcmath/tests/bcmod_error1.phpt13
-rw-r--r--ext/bcmath/tests/bcmul_error1.phpt12
-rw-r--r--ext/bcmath/tests/bcpow_error3.phpt12
-rw-r--r--ext/bcmath/tests/bcpowmod_error1.phpt13
-rw-r--r--ext/bcmath/tests/bcpowmod_error2.phpt13
-rw-r--r--ext/bcmath/tests/bcpowmod_error3.phpt13
-rw-r--r--ext/bcmath/tests/bcsqrt_error2.phpt12
-rw-r--r--ext/bcmath/tests/bcsub_error1.phpt12
-rw-r--r--ext/bcmath/tests/bug60377.phpt4
-rw-r--r--ext/bcmath/tests/bug72093.phpt2
-rw-r--r--ext/bcmath/tests/str2num_formatting.phpt69
47 files changed, 176 insertions, 248 deletions
diff --git a/ext/bcmath/bcmath.c b/ext/bcmath/bcmath.c
index cc9d901fdf..ecfce4f54d 100644
--- a/ext/bcmath/bcmath.c
+++ b/ext/bcmath/bcmath.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -198,11 +198,15 @@ static void php_str2num(bc_num *num, char *str)
char *p;
if (!(p = strchr(str, '.'))) {
- bc_str2num(num, str, 0);
+ if (!bc_str2num(num, str, 0)) {
+ php_error_docref(NULL, E_WARNING, "bcmath function argument is not well-formed");
+ }
return;
}
- bc_str2num(num, str, strlen(p+1));
+ if (!bc_str2num(num, str, strlen(p+1))) {
+ php_error_docref(NULL, E_WARNING, "bcmath function argument is not well-formed");
+ }
}
/* }}} */
@@ -472,7 +476,7 @@ PHP_FUNCTION(bcpow)
/* }}} */
/* {{{ proto string bcsqrt(string operand [, int scale])
- Returns the square root of an arbitray precision number */
+ Returns the square root of an arbitrary precision number */
PHP_FUNCTION(bcsqrt)
{
zend_string *left;
@@ -527,8 +531,12 @@ PHP_FUNCTION(bccomp)
bc_init_num(&first);
bc_init_num(&second);
- bc_str2num(&first, ZSTR_VAL(left), scale);
- bc_str2num(&second, ZSTR_VAL(right), scale);
+ if (!bc_str2num(&first, ZSTR_VAL(left), scale)) {
+ php_error_docref(NULL, E_WARNING, "bcmath function argument is not well-formed");
+ }
+ if (!bc_str2num(&second, ZSTR_VAL(right), scale)) {
+ php_error_docref(NULL, E_WARNING, "bcmath function argument is not well-formed");
+ }
RETVAL_LONG(bc_compare(first, second));
bc_free_num(&first);
@@ -560,12 +568,3 @@ PHP_FUNCTION(bcscale)
#endif
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- * vim600: sw=4 ts=4 fdm=marker
- * vim<600: sw=4 ts=4
- */
diff --git a/ext/bcmath/config.m4 b/ext/bcmath/config.m4
index 1dd2de2dbf..2877a7d4ad 100644
--- a/ext/bcmath/config.m4
+++ b/ext/bcmath/config.m4
@@ -1,7 +1,7 @@
-dnl config.m4 for extension bcmath
-
-PHP_ARG_ENABLE(bcmath, whether to enable bc style precision math functions,
-[ --enable-bcmath Enable bc style precision math functions])
+PHP_ARG_ENABLE([bcmath],
+ [whether to enable bc style precision math functions],
+ [AS_HELP_STRING([--enable-bcmath],
+ [Enable bc style precision math functions])])
if test "$PHP_BCMATH" != "no"; then
PHP_NEW_EXTENSION(bcmath, bcmath.c \
diff --git a/ext/bcmath/libbcmath/AUTHORS b/ext/bcmath/libbcmath/AUTHORS
deleted file mode 100644
index f2d831cf65..0000000000
--- a/ext/bcmath/libbcmath/AUTHORS
+++ /dev/null
@@ -1 +0,0 @@
-Phil Nelson <philnelson@acm.org> wrote bcmath library.
diff --git a/ext/bcmath/libbcmath/ChangeLog b/ext/bcmath/libbcmath/ChangeLog
deleted file mode 100644
index eea6b016e2..0000000000
--- a/ext/bcmath/libbcmath/ChangeLog
+++ /dev/null
@@ -1,9 +0,0 @@
-Wed Jun 7 09:39:02 2000 Phil Nelson <phil@cs.wwu.edu>
-
- * configure.in and many others: version number now at 0.2.
- Many other changes/additions for getting a distribution
- to work.
-
-2000-05-21 Phil Nelson <phil@cs.wwu.edu>
-
- * Initial setup of bcmath library., calling it version 0.1.
diff --git a/ext/bcmath/libbcmath/FAQ b/ext/bcmath/libbcmath/FAQ
deleted file mode 100644
index 423600ac76..0000000000
--- a/ext/bcmath/libbcmath/FAQ
+++ /dev/null
@@ -1,20 +0,0 @@
-BCMATH FAQ:
-
-1) Why BCMATH?
-
-The math routines of GNU bc become more generally useful in a
-library form. By separating the BCMATH library from GNU bc,
-GNU bc can be under the GPL and BCMATH can be under the LGPL.
-
-2) Why BCMATH when GMP exists?
-
-GMP has "integers" (no digits after a decimal), "rational numbers"
-(stored as 2 integers) and "floats". None of these will correctly
-represent a POSIX BC number. Floats are the closest, but will not
-behave correctly for many computations. For example, BC numbers have
-a "scale" that represent the number of digits to represent after the
-decimal point. The multiplying two of these numbers requires one to
-calculate an exact number of digits after the decimal point regardless
-of the number of digits in the integer part. GMP floats have a
-"fixed, but arbitrary" mantissa and so multiplying two floats will end
-up dropping digits BC must calculate.
diff --git a/ext/bcmath/libbcmath/COPYING.LIB b/ext/bcmath/libbcmath/LICENSE
index aa4f4aca85..bb5d10dd73 100644
--- a/ext/bcmath/libbcmath/COPYING.LIB
+++ b/ext/bcmath/libbcmath/LICENSE
@@ -56,7 +56,7 @@ modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
-^L
+
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
@@ -113,7 +113,7 @@ modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
-^L
+
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
@@ -161,7 +161,7 @@ Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
-
+
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
@@ -219,7 +219,7 @@ instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
-^L
+
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
@@ -270,7 +270,7 @@ Library will still fall under Section 6.)
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
-^L
+
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
@@ -332,7 +332,7 @@ restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
-^L
+
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
@@ -373,7 +373,7 @@ subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
-^L
+
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
@@ -426,7 +426,7 @@ conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
-^L
+
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
@@ -460,7 +460,7 @@ SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
-^L
+
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
diff --git a/ext/bcmath/libbcmath/NEWS b/ext/bcmath/libbcmath/NEWS
deleted file mode 100644
index 431d7b315d..0000000000
--- a/ext/bcmath/libbcmath/NEWS
+++ /dev/null
@@ -1,3 +0,0 @@
-NEWS for bcmath library:
-
- May 2000: The library is created.
diff --git a/ext/bcmath/libbcmath/README b/ext/bcmath/libbcmath/README
deleted file mode 100644
index cae5e5dc43..0000000000
--- a/ext/bcmath/libbcmath/README
+++ /dev/null
@@ -1,9 +0,0 @@
-This is bcmath, a library of arbitrary precision math routines.
-These routines, in a different form, are the routines that to
-the arbitrary precision calculations for GNU bc and GNU dc.
-
-This library is provided to make these routines useful in a
-larger context with less restrictions on the use of them.
-
-These routines do not duplicate functionality of the GNU gmp
-library. gmp is similar, but the actual computation is different.
diff --git a/ext/bcmath/libbcmath/README.md b/ext/bcmath/libbcmath/README.md
new file mode 100644
index 0000000000..c0bb465ae1
--- /dev/null
+++ b/ext/bcmath/libbcmath/README.md
@@ -0,0 +1,45 @@
+# The bcmath library
+
+This is a fork of the bcmath library initially created by Phil Nelson in May
+2000.
+
+Bcmath is a library of arbitrary precision math routines. These routines, in a
+different form, are the routines that to the arbitrary precision calculations
+for GNU bc and GNU dc.
+
+This library is provided to make these routines useful in a larger context with
+less restrictions on the use of them.
+
+These routines do not duplicate functionality of the GNU gmp library. The gmp
+library is similar, but the actual computation is different.
+
+Initial library (version 0.1) has been created in 2000-05-21 and then forked and
+bundled into PHP with version 0.2 released in 2000-06-07.
+
+## FAQ
+
+* Why BCMATH?
+
+ The math routines of GNU bc become more generally useful in a library form. By
+ separating the BCMATH library from GNU bc, GNU bc can be under the GPL and
+ BCMATH can be under the LGPL.
+
+* Why BCMATH when GMP exists?
+
+ GMP has "integers" (no digits after a decimal), "rational numbers" (stored as
+ 2 integers) and "floats". None of these will correctly represent a POSIX BC
+ number. Floats are the closest, but will not behave correctly for many
+ computations. For example, BC numbers have a "scale" that represent the number
+ of digits to represent after the decimal point. The multiplying two of these
+ numbers requires one to calculate an exact number of digits after the decimal
+ point regardless of the number of digits in the integer part. GMP floats have
+ a "fixed, but arbitrary" mantissa and so multiplying two floats will end up
+ dropping digits BC must calculate.
+
+## Credits
+
+Phil Nelson (philnelson@acm.org) wrote bcmath library.
+
+## License
+
+The bcmath library is released under the GNU Lesser General Public License v2.1.
diff --git a/ext/bcmath/libbcmath/src/add.c b/ext/bcmath/libbcmath/src/add.c
index 150f27c53c..e92fb0502f 100644
--- a/ext/bcmath/libbcmath/src/add.c
+++ b/ext/bcmath/libbcmath/src/add.c
@@ -11,7 +11,7 @@
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details. (COPYING.LIB)
+ Lesser General Public License for more details. (LICENSE)
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to:
@@ -31,7 +31,6 @@
#include <config.h>
#include <stdio.h>
-#include <assert.h>
#include <stdlib.h>
#include <ctype.h>
#include <stdarg.h>
diff --git a/ext/bcmath/libbcmath/src/bcmath.h b/ext/bcmath/libbcmath/src/bcmath.h
index 78868edcb3..becba7ec3e 100644
--- a/ext/bcmath/libbcmath/src/bcmath.h
+++ b/ext/bcmath/libbcmath/src/bcmath.h
@@ -11,7 +11,7 @@
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details. (COPYING.LIB)
+ Lesser General Public License for more details. (LICENSE)
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to:
@@ -108,7 +108,7 @@ _PROTOTYPE(bc_num bc_copy_num, (bc_num num));
_PROTOTYPE(void bc_init_num, (bc_num *num));
-_PROTOTYPE(void bc_str2num, (bc_num *num, char *str, int scale));
+_PROTOTYPE(int bc_str2num, (bc_num *num, char *str, int scale));
_PROTOTYPE(zend_string *bc_num2str_ex, (bc_num num, int scale));
diff --git a/ext/bcmath/libbcmath/src/compare.c b/ext/bcmath/libbcmath/src/compare.c
index cb7d04e071..f7c4a40399 100644
--- a/ext/bcmath/libbcmath/src/compare.c
+++ b/ext/bcmath/libbcmath/src/compare.c
@@ -11,7 +11,7 @@
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details. (COPYING.LIB)
+ Lesser General Public License for more details. (LICENSE)
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to:
@@ -31,7 +31,6 @@
#include <config.h>
#include <stdio.h>
-#include <assert.h>
#include <stdlib.h>
#include <ctype.h>
#include <stdarg.h>
diff --git a/ext/bcmath/libbcmath/src/debug.c b/ext/bcmath/libbcmath/src/debug.c
index 0ff7d652cd..009e3e37f0 100644
--- a/ext/bcmath/libbcmath/src/debug.c
+++ b/ext/bcmath/libbcmath/src/debug.c
@@ -11,7 +11,7 @@
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details. (COPYING.LIB)
+ Lesser General Public License for more details. (LICENSE)
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to:
@@ -31,7 +31,6 @@
#include <config.h>
#include <stdio.h>
-#include <assert.h>
#include <stdlib.h>
#include <ctype.h>
#include <stdarg.h>
diff --git a/ext/bcmath/libbcmath/src/div.c b/ext/bcmath/libbcmath/src/div.c
index b326ea1250..611feda015 100644
--- a/ext/bcmath/libbcmath/src/div.c
+++ b/ext/bcmath/libbcmath/src/div.c
@@ -11,7 +11,7 @@
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details. (COPYING.LIB)
+ Lesser General Public License for more details. (LICENSE)
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to:
@@ -31,7 +31,6 @@
#include <config.h>
#include <stdio.h>
-#include <assert.h>
#include <stdlib.h>
#include <ctype.h>
#include <stdarg.h>
diff --git a/ext/bcmath/libbcmath/src/divmod.c b/ext/bcmath/libbcmath/src/divmod.c
index 848a4cc850..8b188d2b63 100644
--- a/ext/bcmath/libbcmath/src/divmod.c
+++ b/ext/bcmath/libbcmath/src/divmod.c
@@ -11,7 +11,7 @@
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details. (COPYING.LIB)
+ Lesser General Public License for more details. (LICENSE)
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to:
@@ -31,7 +31,6 @@
#include <config.h>
#include <stdio.h>
-#include <assert.h>
#include <stdlib.h>
#include <ctype.h>
#include <stdarg.h>
diff --git a/ext/bcmath/libbcmath/src/doaddsub.c b/ext/bcmath/libbcmath/src/doaddsub.c
index 991c294e99..fcd768f292 100644
--- a/ext/bcmath/libbcmath/src/doaddsub.c
+++ b/ext/bcmath/libbcmath/src/doaddsub.c
@@ -11,7 +11,7 @@
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details. (COPYING.LIB)
+ Lesser General Public License for more details. (LICENSE)
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to:
@@ -31,7 +31,6 @@
#include <config.h>
#include <stdio.h>
-#include <assert.h>
#include <stdlib.h>
#include <ctype.h>
#include <stdarg.h>
diff --git a/ext/bcmath/libbcmath/src/init.c b/ext/bcmath/libbcmath/src/init.c
index bd73da2a9d..a125947a3e 100644
--- a/ext/bcmath/libbcmath/src/init.c
+++ b/ext/bcmath/libbcmath/src/init.c
@@ -11,7 +11,7 @@
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details. (COPYING.LIB)
+ Lesser General Public License for more details. (LICENSE)
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to:
@@ -31,7 +31,6 @@
#include <config.h>
#include <stdio.h>
-#include <assert.h>
#include <stdlib.h>
#include <ctype.h>
#include <stdarg.h>
diff --git a/ext/bcmath/libbcmath/src/int2num.c b/ext/bcmath/libbcmath/src/int2num.c
index 79a6e19075..3e675b627a 100644
--- a/ext/bcmath/libbcmath/src/int2num.c
+++ b/ext/bcmath/libbcmath/src/int2num.c
@@ -11,7 +11,7 @@
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details. (COPYING.LIB)
+ Lesser General Public License for more details. (LICENSE)
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to:
@@ -31,7 +31,6 @@
#include <config.h>
#include <stdio.h>
-#include <assert.h>
#include <stdlib.h>
#include <ctype.h>
#include <stdarg.h>
diff --git a/ext/bcmath/libbcmath/src/nearzero.c b/ext/bcmath/libbcmath/src/nearzero.c
index 933e501108..0986b02b7a 100644
--- a/ext/bcmath/libbcmath/src/nearzero.c
+++ b/ext/bcmath/libbcmath/src/nearzero.c
@@ -11,7 +11,7 @@
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details. (COPYING.LIB)
+ Lesser General Public License for more details. (LICENSE)
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to:
@@ -31,7 +31,6 @@
#include <config.h>
#include <stdio.h>
-#include <assert.h>
#include <stdlib.h>
#include <ctype.h>
#include <stdarg.h>
diff --git a/ext/bcmath/libbcmath/src/neg.c b/ext/bcmath/libbcmath/src/neg.c
index 65081dbef6..fe6f95aa34 100644
--- a/ext/bcmath/libbcmath/src/neg.c
+++ b/ext/bcmath/libbcmath/src/neg.c
@@ -11,7 +11,7 @@
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details. (COPYING.LIB)
+ Lesser General Public License for more details. (LICENSE)
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to:
@@ -31,7 +31,6 @@
#include <config.h>
#include <stdio.h>
-#include <assert.h>
#include <stdlib.h>
#include <ctype.h>
#include <stdarg.h>
diff --git a/ext/bcmath/libbcmath/src/num2long.c b/ext/bcmath/libbcmath/src/num2long.c
index 228f6645a2..e40a126c72 100644
--- a/ext/bcmath/libbcmath/src/num2long.c
+++ b/ext/bcmath/libbcmath/src/num2long.c
@@ -11,7 +11,7 @@
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details. (COPYING.LIB)
+ Lesser General Public License for more details. (LICENSE)
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to:
@@ -31,7 +31,6 @@
#include <config.h>
#include <stdio.h>
-#include <assert.h>
#include <stdlib.h>
#include <ctype.h>
#include <stdarg.h>
diff --git a/ext/bcmath/libbcmath/src/num2str.c b/ext/bcmath/libbcmath/src/num2str.c
index 7316d32a14..23988c0d6c 100644
--- a/ext/bcmath/libbcmath/src/num2str.c
+++ b/ext/bcmath/libbcmath/src/num2str.c
@@ -11,7 +11,7 @@
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details. (COPYING.LIB)
+ Lesser General Public License for more details. (LICENSE)
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to:
@@ -31,7 +31,6 @@
#include <config.h>
#include <stdio.h>
-#include <assert.h>
#include <stdlib.h>
#include <ctype.h>
#include <stdarg.h>
@@ -51,7 +50,7 @@ zend_string
int index, signch;
/* Allocate the string memory. */
- signch = ( num->n_sign == PLUS ? 0 : 1 ); /* Number of sign chars. */
+ signch = num->n_sign != PLUS; /* Number of sign chars. */
if (scale > 0)
str = zend_string_alloc(num->n_len + scale + signch + 1, 0);
else
diff --git a/ext/bcmath/libbcmath/src/outofmem.c b/ext/bcmath/libbcmath/src/outofmem.c
index 7c67509686..cb2f1085a5 100644
--- a/ext/bcmath/libbcmath/src/outofmem.c
+++ b/ext/bcmath/libbcmath/src/outofmem.c
@@ -11,7 +11,7 @@
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details. (COPYING.LIB)
+ Lesser General Public License for more details. (LICENSE)
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to:
@@ -31,7 +31,6 @@
#include <config.h>
#include <stdio.h>
-#include <assert.h>
#include <stdlib.h>
#include <ctype.h>
#include <stdarg.h>
diff --git a/ext/bcmath/libbcmath/src/output.c b/ext/bcmath/libbcmath/src/output.c
index 9fbca0f4c4..102e9db763 100644
--- a/ext/bcmath/libbcmath/src/output.c
+++ b/ext/bcmath/libbcmath/src/output.c
@@ -11,7 +11,7 @@
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details. (COPYING.LIB)
+ Lesser General Public License for more details. (LICENSE)
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to:
@@ -31,7 +31,6 @@
#include <config.h>
#include <stdio.h>
-#include <assert.h>
#include <stdlib.h>
#include <ctype.h>
#include <stdarg.h>
diff --git a/ext/bcmath/libbcmath/src/private.h b/ext/bcmath/libbcmath/src/private.h
index 32e1120761..0e8ba33d79 100644
--- a/ext/bcmath/libbcmath/src/private.h
+++ b/ext/bcmath/libbcmath/src/private.h
@@ -11,7 +11,7 @@
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details. (COPYING.LIB)
+ Lesser General Public License for more details. (LICENSE)
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to:
diff --git a/ext/bcmath/libbcmath/src/raise.c b/ext/bcmath/libbcmath/src/raise.c
index 81ee03aeed..e00a62e215 100644
--- a/ext/bcmath/libbcmath/src/raise.c
+++ b/ext/bcmath/libbcmath/src/raise.c
@@ -11,7 +11,7 @@
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details. (COPYING.LIB)
+ Lesser General Public License for more details. (LICENSE)
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to:
@@ -31,7 +31,6 @@
#include <config.h>
#include <stdio.h>
-#include <assert.h>
#include <stdlib.h>
#include <ctype.h>
#include <stdarg.h>
diff --git a/ext/bcmath/libbcmath/src/raisemod.c b/ext/bcmath/libbcmath/src/raisemod.c
index a3154b55cd..58f9532545 100644
--- a/ext/bcmath/libbcmath/src/raisemod.c
+++ b/ext/bcmath/libbcmath/src/raisemod.c
@@ -11,7 +11,7 @@
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details. (COPYING.LIB)
+ Lesser General Public License for more details. (LICENSE)
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to:
@@ -31,7 +31,6 @@
#include <config.h>
#include <stdio.h>
-#include <assert.h>
#include <stdlib.h>
#include <ctype.h>
#include <stdarg.h>
@@ -102,6 +101,7 @@ bc_raisemod (bc_num base, bc_num expo, bc_num mod, bc_num *result, int scale)
rscale = MAX(scale, power->n_scale);
if ( !bc_compare(modulus, BCG(_one_)) )
{
+ bc_free_num (&temp);
temp = bc_new_num (1, scale);
}
else
diff --git a/ext/bcmath/libbcmath/src/recmul.c b/ext/bcmath/libbcmath/src/recmul.c
index e397359790..837de3cce9 100644
--- a/ext/bcmath/libbcmath/src/recmul.c
+++ b/ext/bcmath/libbcmath/src/recmul.c
@@ -11,7 +11,7 @@
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details. (COPYING.LIB)
+ Lesser General Public License for more details. (LICENSE)
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to:
diff --git a/ext/bcmath/libbcmath/src/rmzero.c b/ext/bcmath/libbcmath/src/rmzero.c
index 93cc26d12d..5e295c90af 100644
--- a/ext/bcmath/libbcmath/src/rmzero.c
+++ b/ext/bcmath/libbcmath/src/rmzero.c
@@ -11,7 +11,7 @@
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details. (COPYING.LIB)
+ Lesser General Public License for more details. (LICENSE)
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to:
@@ -31,7 +31,6 @@
#include <config.h>
#include <stdio.h>
-#include <assert.h>
#include <stdlib.h>
#include <ctype.h>
#include <stdarg.h>
diff --git a/ext/bcmath/libbcmath/src/sqrt.c b/ext/bcmath/libbcmath/src/sqrt.c
index a7c4d732a6..6358ff7bcd 100644
--- a/ext/bcmath/libbcmath/src/sqrt.c
+++ b/ext/bcmath/libbcmath/src/sqrt.c
@@ -11,7 +11,7 @@
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details. (COPYING.LIB)
+ Lesser General Public License for more details. (LICENSE)
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to:
@@ -31,7 +31,6 @@
#include <config.h>
#include <stdio.h>
-#include <assert.h>
#include <stdlib.h>
#include <ctype.h>
#include <stdarg.h>
diff --git a/ext/bcmath/libbcmath/src/str2num.c b/ext/bcmath/libbcmath/src/str2num.c
index f38d341570..f2d6a73501 100644
--- a/ext/bcmath/libbcmath/src/str2num.c
+++ b/ext/bcmath/libbcmath/src/str2num.c
@@ -11,7 +11,7 @@
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details. (COPYING.LIB)
+ Lesser General Public License for more details. (LICENSE)
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to:
@@ -31,7 +31,6 @@
#include <config.h>
#include <stdio.h>
-#include <assert.h>
#include <stdlib.h>
#include <ctype.h>
#include <stdarg.h>
@@ -40,7 +39,7 @@
/* Convert strings to bc numbers. Base 10 only.*/
-void
+int
bc_str2num (bc_num *num, char *str, int scale)
{
int digits, strscale;
@@ -63,7 +62,7 @@ bc_str2num (bc_num *num, char *str, int scale)
if ((*ptr != '\0') || (digits+strscale == 0))
{
*num = bc_copy_num (BCG(_zero_));
- return;
+ return *ptr == '\0';
}
/* Adjust numbers and allocate storage and initialize fields. */
@@ -108,4 +107,6 @@ bc_str2num (bc_num *num, char *str, int scale)
if (bc_is_zero (*num))
(*num)->n_sign = PLUS;
+
+ return 1;
}
diff --git a/ext/bcmath/libbcmath/src/sub.c b/ext/bcmath/libbcmath/src/sub.c
index 2278b0f14f..2949c71fbb 100644
--- a/ext/bcmath/libbcmath/src/sub.c
+++ b/ext/bcmath/libbcmath/src/sub.c
@@ -11,7 +11,7 @@
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details. (COPYING.LIB)
+ Lesser General Public License for more details. (LICENSE)
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to:
@@ -31,7 +31,6 @@
#include <config.h>
#include <stdio.h>
-#include <assert.h>
#include <stdlib.h>
#include <ctype.h>
#include <stdarg.h>
diff --git a/ext/bcmath/libbcmath/src/zero.c b/ext/bcmath/libbcmath/src/zero.c
index d732dddfcd..2803820124 100644
--- a/ext/bcmath/libbcmath/src/zero.c
+++ b/ext/bcmath/libbcmath/src/zero.c
@@ -11,7 +11,7 @@
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details. (COPYING.LIB)
+ Lesser General Public License for more details. (LICENSE)
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to:
@@ -31,7 +31,6 @@
#include <config.h>
#include <stdio.h>
-#include <assert.h>
#include <stdlib.h>
#include <ctype.h>
#include <stdarg.h>
diff --git a/ext/bcmath/php_bcmath.h b/ext/bcmath/php_bcmath.h
index b72b8dd56d..375513bc92 100644
--- a/ext/bcmath/php_bcmath.h
+++ b/ext/bcmath/php_bcmath.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/bcmath/tests/bcadd_error1.phpt b/ext/bcmath/tests/bcadd_error1.phpt
deleted file mode 100644
index 17a4bc7944..0000000000
--- a/ext/bcmath/tests/bcadd_error1.phpt
+++ /dev/null
@@ -1,12 +0,0 @@
---TEST--
-bcadd() incorrect argument count
---SKIPIF--
-<?php if(!extension_loaded("bcmath")) print "skip"; ?>
---INI--
-bcmath.scale=0
---FILE--
-<?php
-echo bcadd();
-?>
---EXPECTF--
-Warning: bcadd() expects at least 2 parameters, 0 given in %s on line %d
diff --git a/ext/bcmath/tests/bcdiv_error2.phpt b/ext/bcmath/tests/bcdiv_error2.phpt
deleted file mode 100644
index a90c79e459..0000000000
--- a/ext/bcmath/tests/bcdiv_error2.phpt
+++ /dev/null
@@ -1,13 +0,0 @@
---TEST--
-bcdiv — Divide two arbitrary precision numbers
---CREDITS--
-Antoni Torrents
-antoni@solucionsinternet.com
---SKIPIF--
-<?php if(!extension_loaded("bcmath")) print "skip"; ?>
---FILE--
-<?php
-echo bcdiv('1', '2', '3', '4');
-?>
---EXPECTF--
-Warning: bcdiv() expects at most 3 parameters, 4 given in %s.php on line %d
diff --git a/ext/bcmath/tests/bcmod_error1.phpt b/ext/bcmath/tests/bcmod_error1.phpt
deleted file mode 100644
index 68a6dae470..0000000000
--- a/ext/bcmath/tests/bcmod_error1.phpt
+++ /dev/null
@@ -1,13 +0,0 @@
---TEST--
-bcmod — Get modulus of an arbitrary precision number
---CREDITS--
-Antoni Torrents
-antoni@solucionsinternet.com
---SKIPIF--
-<?php if(!extension_loaded("bcmath")) print "skip"; ?>
---FILE--
-<?php
-echo bcmod('1', '2', '3', '4');
-?>
---EXPECTF--
-Warning: bcmod() expects at most 3 parameters, 4 given in %s.php on line %d
diff --git a/ext/bcmath/tests/bcmul_error1.phpt b/ext/bcmath/tests/bcmul_error1.phpt
deleted file mode 100644
index 8d67b98971..0000000000
--- a/ext/bcmath/tests/bcmul_error1.phpt
+++ /dev/null
@@ -1,12 +0,0 @@
---TEST--
-bcmul() incorrect argument count
---SKIPIF--
-<?php if(!extension_loaded("bcmath")) print "skip"; ?>
---INI--
-bcmath.scale=0
---FILE--
-<?php
-echo bcmul();
-?>
---EXPECTF--
-Warning: bcmul() expects at least 2 parameters, 0 given in %s on line %d
diff --git a/ext/bcmath/tests/bcpow_error3.phpt b/ext/bcmath/tests/bcpow_error3.phpt
deleted file mode 100644
index d661c66b14..0000000000
--- a/ext/bcmath/tests/bcpow_error3.phpt
+++ /dev/null
@@ -1,12 +0,0 @@
---TEST--
-bcpow() incorrect argument count
---SKIPIF--
-<?php if(!extension_loaded("bcmath")) print "skip"; ?>
---INI--
-bcmath.scale=0
---FILE--
-<?php
-echo bcpow();
-?>
---EXPECTF--
-Warning: bcpow() expects at least 2 parameters, 0 given in %s on line %d
diff --git a/ext/bcmath/tests/bcpowmod_error1.phpt b/ext/bcmath/tests/bcpowmod_error1.phpt
deleted file mode 100644
index 2dc292eb54..0000000000
--- a/ext/bcmath/tests/bcpowmod_error1.phpt
+++ /dev/null
@@ -1,13 +0,0 @@
---TEST--
-bcpowmod — Raise an arbitrary precision number to another, reduced by a specified modulus
---CREDITS--
-Antoni Torrents
-antoni@solucionsinternet.com
---SKIPIF--
-<?php if(!extension_loaded("bcmath")) print "skip"; ?>
---FILE--
-<?php
-echo bcpowmod('1');
-?>
---EXPECTF--
-Warning: bcpowmod() expects at least 3 parameters, 1 given in %s.php on line %d
diff --git a/ext/bcmath/tests/bcpowmod_error2.phpt b/ext/bcmath/tests/bcpowmod_error2.phpt
deleted file mode 100644
index e0a99637ca..0000000000
--- a/ext/bcmath/tests/bcpowmod_error2.phpt
+++ /dev/null
@@ -1,13 +0,0 @@
---TEST--
-bcpowmod — Raise an arbitrary precision number to another, reduced by a specified modulus
---CREDITS--
-Antoni Torrents
-antoni@solucionsinternet.com
---SKIPIF--
-<?php if(!extension_loaded("bcmath")) print "skip"; ?>
---FILE--
-<?php
-echo bcpowmod('1', '2');
-?>
---EXPECTF--
-Warning: bcpowmod() expects at least 3 parameters, 2 given in %s.php on line %d
diff --git a/ext/bcmath/tests/bcpowmod_error3.phpt b/ext/bcmath/tests/bcpowmod_error3.phpt
deleted file mode 100644
index c3f8df8269..0000000000
--- a/ext/bcmath/tests/bcpowmod_error3.phpt
+++ /dev/null
@@ -1,13 +0,0 @@
---TEST--
-bcpowmod — Raise an arbitrary precision number to another, reduced by a specified modulus
---CREDITS--
-Antoni Torrents
-antoni@solucionsinternet.com
---SKIPIF--
-<?php if(!extension_loaded("bcmath")) print "skip"; ?>
---FILE--
-<?php
-echo bcpowmod('1', '2', '3', '4', '5');
-?>
---EXPECTF--
-Warning: bcpowmod() expects at most 4 parameters, 5 given in %s.php on line %d
diff --git a/ext/bcmath/tests/bcsqrt_error2.phpt b/ext/bcmath/tests/bcsqrt_error2.phpt
deleted file mode 100644
index d7ce2e5c88..0000000000
--- a/ext/bcmath/tests/bcsqrt_error2.phpt
+++ /dev/null
@@ -1,12 +0,0 @@
---TEST--
-bcsqrt() incorrect argument count
---SKIPIF--
-<?php if(!extension_loaded("bcmath")) print "skip"; ?>
---INI--
-bcmath.scale=0
---FILE--
-<?php
-echo bcsqrt();
-?>
---EXPECTF--
-Warning: bcsqrt() expects at least 1 parameter, 0 given in %s on line %d
diff --git a/ext/bcmath/tests/bcsub_error1.phpt b/ext/bcmath/tests/bcsub_error1.phpt
deleted file mode 100644
index 1600652ac1..0000000000
--- a/ext/bcmath/tests/bcsub_error1.phpt
+++ /dev/null
@@ -1,12 +0,0 @@
---TEST--
-bcsub() incorrect argument count
---SKIPIF--
-<?php if(!extension_loaded("bcmath")) print "skip"; ?>
---INI--
-bcmath.scale=0
---FILE--
-<?php
-echo bcsub();
-?>
---EXPECTF--
-Warning: bcsub() expects at least 2 parameters, 0 given in %s on line %d
diff --git a/ext/bcmath/tests/bug60377.phpt b/ext/bcmath/tests/bug60377.phpt
index 929790d16a..eb140d92cf 100644
--- a/ext/bcmath/tests/bug60377.phpt
+++ b/ext/bcmath/tests/bug60377.phpt
@@ -6,8 +6,8 @@ if (PHP_INT_SIZE != 8) die("skip: 64-bit only"); ?>
--FILE--
<?php
$var48 = bcscale(634314234334311);
-$var67 = bcsqrt(false);
-$var414 = bcadd(false,null,10);
+$var67 = bcsqrt(0);
+$var414 = bcadd(0,-1,10);
die('ALIVE');
?>
--EXPECT--
diff --git a/ext/bcmath/tests/bug72093.phpt b/ext/bcmath/tests/bug72093.phpt
index 3aca87a39c..4295384a30 100644
--- a/ext/bcmath/tests/bug72093.phpt
+++ b/ext/bcmath/tests/bug72093.phpt
@@ -6,7 +6,7 @@ if(!extension_loaded("bcmath")) print "skip";
?>
--FILE--
<?php
-var_dump(bcpowmod(1, "A", 128, -200));
+var_dump(bcpowmod(1, 0, 128, -200));
var_dump(bcpowmod(1, 1.2, 1, 1));
?>
--EXPECTF--
diff --git a/ext/bcmath/tests/str2num_formatting.phpt b/ext/bcmath/tests/str2num_formatting.phpt
new file mode 100644
index 0000000000..090dd44d53
--- /dev/null
+++ b/ext/bcmath/tests/str2num_formatting.phpt
@@ -0,0 +1,69 @@
+--TEST--
+bcmath lib arguments formatting
+--DESCRIPTION--
+1 and 2 argument of bcadd/bcsub/bcmul/bcdiv/bcmod/bcpowmod/bcpow/bccomp (last one works different then others internally);
+1 argument of bcsqrt
+All of the name above must be well-formed
+--SKIPIF--
+<?php if(!extension_loaded("bcmath")) print "skip"; ?>
+--FILE--
+<?php
+echo bcadd("1", "2"),"\n";
+echo bcadd("1.1", "2", 2),"\n";
+echo bcadd("", "2", 2),"\n";
+echo bcadd("+0", "2"), "\n";
+echo bcadd("-0", "2"), "\n";
+
+echo bcadd(" 0", "2");
+echo bcadd("1e1", "2");
+echo bcadd("1,1", "2");
+echo bcadd("Hello", "2");
+echo bcadd("1 1", "2");
+echo "\n", "\n";
+
+echo bccomp("1", "2"),"\n";
+echo bccomp("1.1", "2", 2),"\n";
+echo bccomp("", "2"),"\n";
+echo bccomp("+0", "2"), "\n";
+echo bccomp("-0", "2"), "\n";
+
+echo bccomp(" 0", "2");
+echo bccomp("1e1", "2");
+echo bccomp("1,1", "2");
+echo bccomp("Hello", "2");
+echo bccomp("1 1", "2");
+?>
+--EXPECTF--
+3
+3.10
+2.00
+2
+2
+
+Warning: bcadd(): bcmath function argument is not well-formed in %s on line %d
+2
+Warning: bcadd(): bcmath function argument is not well-formed in %s on line %d
+2
+Warning: bcadd(): bcmath function argument is not well-formed in %s on line %d
+2
+Warning: bcadd(): bcmath function argument is not well-formed in %s on line %d
+2
+Warning: bcadd(): bcmath function argument is not well-formed in %s on line %d
+2
+
+-1
+-1
+-1
+-1
+-1
+
+Warning: bccomp(): bcmath function argument is not well-formed in %s on line %d
+-1
+Warning: bccomp(): bcmath function argument is not well-formed in %s on line %d
+-1
+Warning: bccomp(): bcmath function argument is not well-formed in %s on line %d
+-1
+Warning: bccomp(): bcmath function argument is not well-formed in %s on line %d
+-1
+Warning: bccomp(): bcmath function argument is not well-formed in %s on line %d
+-1 \ No newline at end of file