Commit Graph

294 Commits

Author SHA1 Message Date
Gabriel Caruso
ded3d984c6 Use EXPECT instead of EXPECTF when possible
EXPECTF logic in run-tests.php is considerable, so let's avoid it.
2018-02-20 21:53:48 +01:00
Nikita Popov
bcc7d46aa4 Merge branch 'PHP-7.2' 2018-02-19 21:46:20 +01:00
Nikita Popov
1b6a9ea584 Merge branch 'PHP-7.1' into PHP-7.2 2018-02-19 21:46:11 +01:00
Nikita Popov
7b3a2d16aa Fix incorrect printf modifiers 2018-02-19 21:44:36 +01:00
Anatol Belski
ec5d9ab82b Reduce variable scope 2018-02-18 19:15:36 +01:00
Anatol Belski
8eda7d9410 Remove effectless assignment 2018-02-18 19:07:25 +01:00
Gabriel Caruso
414aaa207c
Use bool instead of boolean 2018-02-08 10:00:49 +01:00
Gabriel Caruso
ce1d69a1f6 Use int instead of integer in type errors
PHP requires integer typehints to be written "int" and does not
allow "integer" as an alias. This changes type error messages to
match the actual type name and avoids confusing messages like
"must be of the type integer, integer given".
2018-02-04 19:08:23 +01:00
Gabriel Caruso
c6c9e71a5b Add missing SKIPIF sections 2018-02-03 13:54:34 +01:00
Anatol Belski
f4076bb1b3 Merge branch 'PHP-7.2'
* PHP-7.2:
  Skip on Travis-CI
2018-01-03 18:36:34 +01:00
Anatol Belski
4635cc5b9d Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Skip on Travis-CI
2018-01-03 18:36:10 +01:00
Anatol Belski
904e0d7212 Skip on Travis-CI
The current doc states max ram for a test VM would be 7.5G, the
currently used container image has even less. This skip should be
revisited, as the available memory amount shifts. The way of checking
/proc/meminfo doesn't work reliably on containers at least, thus
skipping explicitly on Travis-CI makes sense.
2018-01-03 18:32:33 +01:00
Anatol Belski
5361bf3312 Merge branch 'PHP-7.2'
* PHP-7.2:
  Extend skip section
2018-01-03 16:56:42 +01:00
Anatol Belski
e282e52967 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Extend skip section
2018-01-03 16:56:00 +01:00
Anatol Belski
2508d5051f Extend skip section
The test requires some untrivial amount of RAM. Added a simple check for
the system free RAM to avoid false positive fails.
2018-01-03 16:54:14 +01:00
Stanislav Malyshev
77298dee2e Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix some int/long confusion issues in GMP
2018-01-02 00:12:43 -08:00
Stanislav Malyshev
4380ba7f9c Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix some int/long confusion issues in GMP
2018-01-02 00:12:33 -08:00
Stanislav Malyshev
c0f0a0a862 Fix some int/long confusion issues in GMP
mpz_setbit seems to have limit of INT_MAX * GMP_NUMB_BITS on
the number of bits supported, and will abort() if that limit
is exceeded.
2018-01-02 00:12:24 -08:00
Xinchen Hui
a6519d0514 year++ 2018-01-02 12:57:58 +08:00
Xinchen Hui
7a7ec01a49 year++ 2018-01-02 12:55:14 +08:00
Xinchen Hui
ccd4716ec7 year++ 2018-01-02 12:53:31 +08:00
Nikita Popov
b2b2b437af Add _IS_NUMBER as cast_object() target type
convert_scalar_to_number() will now call cast_object() with an
_IS_NUMBER argument, in which case the cast handler should return
either an integer or floating point number, whichever is more
appropriate.

Previously convert_scalar_to_number() unconditionally converted
objects to integers instead.

Fixes bug #53033.
Fixes bug #54973.
Fixes bug #73108.
2017-12-26 12:39:06 +01:00
Dmitry Stogov
9e709e2fa0 Move constants into read-only data segment 2017-12-14 18:43:44 +03:00
Nikita Popov
fc80114a48 Add gmp_kronecker()
Exposes the mpz_kronecker(), mpz_si_kronecker() and
mpz_kronecher_si() for computing the Kronecker symbol.
2017-12-11 19:25:54 +01:00
Nikita Popov
10a336d3d0 Add gmp_perfect_power()
Exposes the mpz_perfect_power_p() function.

We already had the more specific gmp_perfect_square() function.
2017-12-11 19:25:54 +01:00
Nikita Popov
a1d36a1157 Add gmp_lcm()
Exposes mpz_lcm() and mpz_lcm_ui() for calculating the least
common multiple.

We already expose the somewhat complementary gmp_gcd() function.
2017-12-11 19:25:54 +01:00
Nikita Popov
7fea79675c Add gmp_binomial()
Adds PHP bindings for mpz_bin_ui and mpz_bin_uiui, for calculating
binomial coefficients.
2017-12-11 19:25:54 +01:00
Peter Kokot
2783b1c823 Remove outdated TODO files
Some extensions included TODO files that has been present for several
years in the repository tree without changes. This included:

- ext/phar
- ext/intl
- ext/zip
- ext/soap
- ext/pdo
- ext/spl
- ext/dom
- ext/gmp
- ext/xmlwriter
- ext/xmlreader

ext/phar feature request has been created instead, and for others it
would be better to use wiki and RFC workflow instead based on current
feature requests and further PHP development requirements.

[ci skip]
2017-12-09 19:18:58 +01:00
Anatol Belski
60d45e6a5b Fix visibility 2017-10-23 13:27:34 +02:00
Dmitry Stogov
61ef91bf0d Revert "Allow internal functions to return values by reference (this was disabled in implementation of DO_ICALL, but enabled in DO_FCALL)."
This reverts commit da781a5ac2.
2017-10-17 13:25:19 +03:00
Dmitry Stogov
da781a5ac2 Allow internal functions to return values by reference (this was disabled in implementation of DO_ICALL, but enabled in DO_FCALL).
However, don't require internal functions returning by reference to return a reference.
Mark unserialize() as returning by reference and remove unwrap_reference hack, to allow proper returning of self referenced arrays using a reference.
Currently unserialize() is the only internal function that may return a reference.
2017-10-17 11:50:34 +03:00
Dmitry Stogov
f26fc527da Fixed unzserialize(), to disable creation of unsupported data structures through manually crafted strings. (Dmitry) 2017-10-13 15:53:11 +03:00
Sara Golemon
e05cba0806 Make GMP more usable by third-party extensions.
Export a PHPAPI function to return gmp_ce (and make the actual storage static).
Provide gmp_object struct in header w/ inline accessor.
Install php_gmp_int.h header.

Remove unnecessary `#ifdef HAVE_GMP` checks.
2017-10-09 13:23:10 -04:00
Peter Kokot
83e881bbb6
Remove outdated README from ext/gmp
The PHP manual now includes better GMP introduction with updated links
to GNU MP library homepage.
2017-10-03 07:25:35 +01:00
Kalle Sommer Nielsen
0ae3b45d25 Fix test location 2017-08-17 22:11:20 +02:00
Nikita Popov
fbeb900be4 Deprecate gmp_random() 2017-02-03 18:52:57 +01:00
Nikita Popov
959c8975a9 Merge branch 'PHP-7.1' 2017-01-14 14:13:49 +01:00
Nikita Popov
6674f81027 Merge branch 'PHP-7.0' into PHP-7.1 2017-01-14 14:13:42 +01:00
Yordan Gigov
60aff0bd30 Fixed bug #69993 2017-01-14 14:13:15 +01:00
Sammy Kaye Powers
dac6c639bb Update copyright headers to 2017 2017-01-04 11:23:42 -06:00
Sammy Kaye Powers
478f119ab9 Update copyright headers to 2017 2017-01-04 11:14:55 -06:00
Sammy Kaye Powers
9e29f841ce Update copyright headers to 2017 2017-01-02 09:30:12 -06:00
Christoph M. Becker
fcc6f2df59 Merge branch 'PHP-7.1' 2016-09-06 14:15:05 +02:00
Christoph M. Becker
727b422ad9 Fix #72948: Uncatchable "Catchable" fatal error for class to string conversions
E_RECOVERABLE errors are reported as "Catchable fatal error". This is
misleading, because they actually can't be caught via try-catch statements.
Therefore we change the wording to "Recoverable fatal error" as suggested by
Nikita.
2016-09-03 13:05:37 +02:00
Sara Golemon
665050787c Bugfix#70896 gmp_fact() silently ignores non-integer inputs
Factorials only make sense for integer inputs.
To do something factorial-like, the Gamma Function
should be used instead.
However, at this point it's no longer a factorial.

For PHP/GMP, we'll raise a warning on trying to use
a non-integer input, but carry on returning the truncated
value as we used to (avoiding BC breakage).
2016-07-26 22:04:18 -07:00
Nikita Popov
91f22a2088 Merge branch 'PHP-7.1' 2016-07-25 23:04:25 +02:00
Nikita Popov
4d2479202a Merge branch 'PHP-7.0' into PHP-7.1 2016-07-25 23:04:14 +02:00
Nikita Popov
b1d36cb820 Fix GMP unserialization with self-reference 2016-07-25 23:04:00 +02:00
Nikita Popov
5d0ae32c35 Cleanup gmp_sqrtrem() test 2016-07-25 22:07:56 +02:00
Dmitry Stogov
1616038698 Added ZEND_ATTRIBUTE_FORMAT to some middind functions.
"%p" replaced by ZEND_LONG_FMT to avoid compilation warnings.
Fixed most incorrect use cases of format specifiers.
2016-06-21 16:00:37 +03:00