Commit graph

139 commits

Author SHA1 Message Date
Nikita Popov
895a22c03c Add missing image_type_to_extension() argument 2020-07-17 15:24:41 +02:00
Christoph M. Becker
ae7554270f Fix #79805: sapi_windows_vt100_support throws TypeError
It does not make sense to throw a `TypeError` when the stream can't be
analyzed.  If `sapi_windows_vt100_support()` is used as getter, we just
return `false` in that case; if the function is used as setter, we
additionally trigger a warning.

We also fix the test cases for this function, which have been broken
before.  Note that these tests are still whitespace sensitive.
2020-07-16 18:36:02 +02:00
George Peter Banyard
c4a0ba8d6e Refactor levenshtein()
Closes GH-5816
2020-07-07 00:41:10 +02:00
Christoph M. Becker
fecea7b89c Fix sapi_windows_vt100_support() arginfo 2020-07-06 10:48:10 +02:00
Nikita Popov
c9b9f525a9 Include stub hash in generated arginfo files
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.
2020-06-24 09:55:19 +02:00
Máté Kocsis
aa9b0ccda8
Add tests to check mismatching function signatures
Closes GH-5666
2020-06-06 09:23:34 +02:00
Nikita Popov
6b45039fb7 Add some mixed types 2020-06-02 10:16:13 +02:00
Máté Kocsis
b3718430de
Annotate internal functions with the mixed type
Closes GH-5618
2020-05-25 17:30:57 +02:00
Máté Kocsis
cbf86efc21
Fix ZPP of v*printf() 2020-05-25 17:29:46 +02:00
Nikita Popov
50a9f511cc Allow null callback to array_filter()
With same behavior as not passing it.
2020-05-13 17:24:13 +02:00
William Hudgins
31fb6a08b3 Add str_starts_with() and str_ends_with()
RFC: https://wiki.php.net/rfc/add_str_starts_with_and_ends_with_functions

Closes GH-5300.
2020-05-05 16:03:47 +02:00
George Peter Banyard
8d346f7679 Use ZPP int|string and add ValueError for Windows codepages
Closes GH-5517
2020-05-04 12:44:54 +02:00
George Peter Banyard
34f727e637 Use ZPP check for string|int|null arguments in array_column() 2020-05-02 19:50:51 +02:00
Máté Kocsis
31a626cf7e
Remove the deprecated is_real() function
Closes GH-5506
2020-05-01 15:33:58 +02:00
Your Name
ef0e4478c5 Add get_debug_type() function
RFC: https://wiki.php.net/rfc/get_debug_type
2020-04-23 10:45:08 +02:00
Máté Kocsis
beff93f60d
Fix the default parameter values of stream_socket_client()
$timeout and $flags were mixed up
2020-04-10 17:17:12 +02:00
Nikita Popov
fcc6da3e42 Mark $time argument of touch() as UNKNOWN as well
For some reason I thought that passing 0 is same as current time,
but that's not the case.
2020-04-09 16:54:42 +02:00
Nikita Popov
636c827aa2 Mark fgets() argument as UNKNOWN
If no value is passed, this reads as much as necessary, not 1024
bytes.
2020-04-09 16:22:34 +02:00
Christoph M. Becker
62e8dcbc48 Change parameter default to always available value
`SIGTERM` is only defined in ext/pcntl, and as such never available on
Windows.  Moving the constant to ext/standard does not make much sense,
because that parameter is actually unused on Windows.  Therefore, we
use the magic number `15` instead, what is also done in the PHP manual.
2020-04-09 16:15:47 +02:00
Nikita Popov
87ba975e31 Make touch() $atime parameter UNKNOWN
The actual default here is $time, not 0.
2020-04-09 16:11:17 +02:00
Nikita Popov
258c4dfdb2 Mark rand/mt_rand args as UNKNOWN
The second argument should be mt_getrandmax(), not PHP_INT_MAX.
Additionally this function only accepts either zero or two arguments,
so err on the side of being conservative and mark both UNKNOWN.
2020-04-09 16:10:56 +02:00
Nikita Popov
1dcb559664 Mark array_walk $userdata arg as UNKNOWN
It makes a difference whether this arg is not passed or is null.
2020-04-09 16:10:39 +02:00
Máté Kocsis
3709e74b5e
Store default parameter values of internal functions in arg info
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>
2020-04-08 18:37:51 +02:00
Nikita Popov
2bcc4ab8f4 Verify that all stubs have a return type 2020-04-03 17:59:30 +02:00
Nikita Popov
51bc6233b2 Generate function entries from stubs
If @generate-function-entries is specified in the stub file,
also generate function entries for the extension.

Currently limited to free functions only.
2020-04-03 15:41:41 +02:00
Máté Kocsis
305b17e85f
Do not include the same stub multiple times
Closes GH-5322
2020-04-03 14:23:54 +02:00
Nikita Popov
97cb81ead5 Remove HAVE_REALPATH checks
We do not actually use realpath(), but a custom implementation.
Make sure the realpath() function is always available.

Closes GH-5290.
2020-03-26 11:46:00 +01:00
Philipp Tanlak
1668ad7cb1 Add str_contains() function
RFC: https://wiki.php.net/rfc/str_contains

Closes GH-5179.
2020-03-16 11:05:26 +01:00
Nikita Popov
1892def3a8 Add rand() to ext/standard stub 2020-02-21 16:27:59 +01:00
Máté Kocsis
c231bbb852
Remove restore_include_path()
Closes GH-5189
2020-02-20 09:11:36 +01:00
Máté Kocsis
736b22dc0b
Add stubs for aliases
Closes GH-5187
2020-02-18 21:10:36 +01:00
Christoph M. Becker
7d0102dfa7 Revert "Replace @param annotations with type declarations"
This reverts commit c31029f335.
2020-02-17 08:55:18 +01:00
Christoph M. Becker
c31029f335 Replace @param annotations with type declarations 2020-02-16 23:43:38 +01:00
Christoph M. Becker
b442c89a23 Fix arginfo
These parameters accept int|float, since they are parsed with
`Z_PARAM_NUMBER`.
2020-02-16 14:29:36 +01:00
Máté Kocsis
d59bc80782
Fix smaller issues with stubs
GH-5025
2019-12-20 14:31:07 +01:00
Máté Kocsis
297b1f8335
Fix return type of strval()
GH-5024
2019-12-20 12:02:35 +01:00
Máté Kocsis
d7b2082352
Add stubs for standard library
Closes GH-5017
2019-12-20 12:01:35 +01:00
Máté Kocsis
2ab123b84e
Convert string|array union parameter types
Closes GH-4995
2019-12-20 10:15:52 +01:00
Máté Kocsis
beee92a887
Remove support for mixing parameter order in implode() 2019-12-12 13:49:05 +01:00
Máté Kocsis
37c1171451
Promote warnings to exceptions in password_*() functions 2019-12-12 12:14:53 +01:00
George Peter Banyard
4782e8e28a Return empty string instead of NULL in serialize().
Modifiy its return type accordingly and arginfo.
2019-12-12 00:01:28 +01:00
Máté Kocsis
51eefd8079
Add stubs for standard library 2019-12-11 18:50:36 +01:00
Máté Kocsis
9563449d8b
Add stubs for another batch of standard functions 2019-12-09 19:47:08 +01:00
Máté Kocsis
29ef07728e
Remove magic quotes legacy 2019-12-05 13:15:54 +01:00
Máté Kocsis
633926021b
Remove ezmlm_hash() function 2019-12-05 13:15:54 +01:00
Máté Kocsis
144b41ce88
Remove money_format() function 2019-12-05 13:15:54 +01:00
Máté Kocsis
64468d1e3b
Remove convert_cyr_string() function 2019-12-05 13:15:54 +01:00
Máté Kocsis
b63c625260
Remove hebrevc() function 2019-12-05 13:15:54 +01:00
Nikita Popov
a603c06e2e Support "string or array" in zpp
This is one of our more common argument unions. Usage is just
prototyped in a few places, certainly not a full conversion.

I'm removing the str_replace.phpt test, because aparently it was
split up into smaller tests at some point, but the original has
not been removed.

Closes GH-4970.
2019-12-05 12:25:57 +01:00
Máté Kocsis
04deb532f0
Promote warning to exception in log() function 2019-12-05 08:30:47 +01:00