summaryrefslogtreecommitdiff
path: root/ext/gmp
Commit message (Collapse)AuthorAgeFilesLines
* Improve class entry generationMáté Kocsis2021-02-161-2/+1
| | | | Related to GH-6701
* Deprecate passing null to non-nullable arg of internal functionNikita Popov2021-02-111-1/+1
| | | | | | | | | | | | | | | | | | | | | This deprecates passing null to non-nullable scale arguments of internal functions, with the eventual goal of making the behavior consistent with userland functions, where null is never accepted for non-nullable arguments. This change is expected to cause quite a lot of fallout. In most cases, calling code should be adjusted to avoid passing null. In some cases, PHP should be adjusted to make some function arguments nullable. I have already fixed a number of functions before landing this, but feel free to file a bug if you encounter a function that doesn't accept null, but probably should. (The rule of thumb for this to be applicable is that the function must have special behavior for 0 or "", which is distinct from the natural behavior of the parameter.) RFC: https://wiki.php.net/rfc/deprecate_null_to_scalar_internal_arg Closes GH-6475.
* Implicitly enable function entry generation when class entry generation is ↵Máté Kocsis2021-02-092-5/+2
| | | | | | enabled Closes GH-6675
* Generate class entries from stubs for another batch of extensionsMáté Kocsis2021-02-083-5/+17
| | | | Closes GH-6669
* Replace zend_bool uses with boolNikita Popov2021-01-152-6/+6
| | | | | | | We're starting to see a mix between uses of zend_bool and bool. Replace all usages with the standard bool type everywhere. Of course, zend_bool is retained as an alias.
* Implement Explicit octal notation for integers RFCGeorge Peter Banyard2021-01-043-0/+86
| | | | | | | | RFC: https://wiki.php.net/rfc/explicit_octal_notation Add an extensive test suits for other variants of integer literals Closes GH-6360
* Fix newly added GMP testNikita Popov2021-01-041-1/+1
|
* Fix GMP comparison object handlerGeorge Peter Banyard2021-01-042-1/+29
| | | | | | | gmp_cmp() doesn't return false anymore in PHP 8 but will throw an Error if compared to a non numeric string or another type of object. Closes GH-6553
* Throw ValueError instead of TypeError for malformed GMP numberNikita Popov2021-01-0419-60/+60
| | | | | | | If the passed argument has correct type (string) but does not have a well-formed value, throw ValueError instead of TypeError. Closes GH-6572.
* Fix #80560: Strings containing only a base prefix return 0 objectGeorge Peter Banyard2020-12-302-3/+225
| | | | Closes GH-6549.
* Merge branch 'PHP-7.4' into PHP-8.0Nikita Popov2020-10-152-2/+6
|\ | | | | | | | | * PHP-7.4: Fix leak in gmp_export()
| * Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2020-10-152-2/+6
| |\ | | | | | | | | | | | | * PHP-7.3: Fix leak in gmp_export()
| | * Fix leak in gmp_export()Nikita Popov2020-10-152-2/+6
| | |
| | * Sync leading and final newlines in *.phpt sectionsPeter Kokot2018-10-152-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| | * Trim trailing whitespace in *.phptPeter Kokot2018-10-1444-49/+49
| | |
* | | Update gmp+bcmath parameter namesNikita Popov2020-09-2942-201/+199
| | | | | | | | | | | | Closes GH-6205.
* | | Run tidyNikita Popov2020-09-182-14/+14
| | | | | | | | | | | | | | | This should fix most of the remaining issues with tabs and spaces being mixed in tests.
* | | Accept GMP|string|int union in GMP functionsNikita Popov2020-09-1636-332/+275
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes GMP functions to accept a GMP|string|int union with standard semantics (and thus also uses it in function signatures). Relative to the previous behavior, this means that GMP functions in weak mode now also accept float and null, and in strict mode no longer accept bool, and have full type information. Closes GH-6139.
* | | Remove unused GMP_ABS() macroNikita Popov2020-09-161-1/+0
| | |
* | | Add many missing closing PHP tags to testsMáté Kocsis2020-08-092-0/+2
| | | | | | | | | | | | Closes GH-5958
* | | Promote various warnings to Error in GMP extensionGeorge Peter Banyard2020-08-0752-944/+1290
| | | | | | | | | | | | | | | | | | This gets rid of most false returns Closes GH-5882
* | | Add a few missing parameter types in stubsMáté Kocsis2020-07-302-7/+7
| | | | | | | | | | | | Related to GH-5627
* | | Remove proto comments from C filesMax Semenik2020-07-061-120/+60
| | | | | | | | | | | | Closes GH-5758
* | | Include stub hash in generated arginfo filesNikita Popov2020-06-241-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The hash is used to check whether the arginfo file needs to be regenerated. PHP-Parser will only be downloaded if this is actually necessary. This ensures that release artifacts will never try to regenerate stubs and thus fetch PHP-Parser, as long as you do not modify any files. Closes GH-5739.
* | | Fix warning of strict-prototypestwosee2020-06-072-2/+2
| | | | | | | | | | | | Closes GH-5673.
* | | Promote warning related to operator overloading in ext/gmp to an exceptionMáté Kocsis2020-05-256-25/+82
| | |
* | | Fix function signature mismatches in GMPNikita Popov2020-04-151-46/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is fairly annoying. Add adapter functions for cases where we are discarding a return value. Some of the issues are legitimate in that we were previously truncating some unsigned long return values to int implicitly, though I doubt it makes a difference in practice. This fixes -Wcast-function-type warnings.
* | | Store default parameter values of internal functions in arg infoMáté Kocsis2020-04-081-10/+10
| | | | | | | | | | | | | | | | | | | | | Closes GH-5353. From now on, PHP will have reflection information about default values of parameters of internal functions. Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
* | | Generate functions entries from stubs for another set of extensionsMáté Kocsis2020-04-054-111/+111
| | | | | | | | | | | | Closes GH-5351
* | | Annotate function aliases in stubsMáté Kocsis2020-04-041-0/+1
| | |
* | | Change argument error message formatMáté Kocsis2020-02-263-4/+4
| | | | | | | | | | | | Closes GH-5211
* | | Make type error messages more consistentMáté Kocsis2020-02-173-4/+4
| | | | | | | | | | | | Closes GH-5092
* | | Revert "Replace @param annotations with type declarations"Christoph M. Becker2020-02-172-2/+3
| | | | | | | | | | | | This reverts commit c31029f335ca1b453af799805c43c37e959ad555.
* | | Replace @param annotations with type declarationsChristoph M. Becker2020-02-162-3/+2
| | |
* | | Reindent phpt filesNikita Popov2020-02-039-74/+74
| | |
* | | Fix #78880: Another bunch of spelling errorsMáté Kocsis2020-01-161-1/+1
| | |
* | | Use ZEND_THROWS() during ZPP in the GD, gettext, GMP, and hash extensionsMáté Kocsis2019-12-311-36/+36
| | |
* | | Add union return types with one classMáté Kocsis2019-11-182-107/+58
| | |
* | | Add union return types for function stubsMáté Kocsis2019-11-112-80/+59
| | |
* | | Comparison cleanup:Dmitry Stogov2019-10-071-5/+7
| | | | | | | | | | | | | | | - introduce zend_compare() that returns -1,0,1 dirctly (without intermediate zval) - remove compare_objects() object handler, and keep only compare() handler
* | | Fix required number of arguments in stubsNikita Popov2019-10-072-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | * get_parent_class() argument is optional * Mark array_filter() $callback as optional * The $base of gmp_strval() is optional * DateTime constructor also accepts zero arguments * hash_update_file() stream context is optional * xmlwriter_write_dtd_entity() $isparam argument is optional
* | | Remove mention of PHP major version in Copyright headersGabriel Caruso2019-09-252-4/+0
| | | | | | | | | | | | Closes GH-4732.
* | | Merge branch 'PHP-7.4'Remi Collet2019-09-201-1/+1
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fixed bug #78574 (broken shared build)
| * | Fixed bug #78574 (broken shared build)Remi Collet2019-09-201-1/+1
| | |
* | | Merge branch 'PHP-7.4'Nikita Popov2019-09-061-16/+18
|\ \ \ | |/ /
| * | Fix detection of gmp on clangNikita Popov2019-09-061-16/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | Split the default and custom path case. If the default is used, assume that the library must be on the default include and lib path. Only check that the version is appropriate. Something similar is needed for ldap, but the checking code is much more complex there, so I'm only adding a workaround for now.
* | | Fix typo in typeNikita Popov2019-09-021-1/+1
| | |
* | | Add ext/gmp stubsChristoph M. Becker2019-08-253-131/+511
| | |
* | | Merge branch 'PHP-7.4'Peter Kokot2019-07-181-1/+0
|\ \ \ | |/ / | | | | | | | | | | | | * PHP-7.4: Fix typo Remove unused defines
| * | Remove unused definesPeter Kokot2019-07-181-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Used in php-src the past and today removed and not used anymore: - HAVE_CURL_EASY_STRERROR - HAVE_CURL_MULTI_STRERROR - HAVE_NEW_MIME2TEXT - HAVE_MBSTR_CN - HAVE_MBSTR_JA - HAVE_MBSTR_KR - HAVE_MBSTR_RU - HAVE_MBSTR_TW Part of oniguruma which doesn't use these anymore - NOT_RUBY - HAVE_STDARG_PROTOTYPES Unused: - HAVE_MPIR Closes GH-4427