1
0
mirror of https://github.com/php/php-src.git synced 2026-03-28 02:02:32 +01:00
Commit Graph

77 Commits

Author SHA1 Message Date
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
Nikita Popov
b3f3a80f9c Make stream_socket_enable_crypto() session stream nullable 2020-04-09 16:10:33 +02:00
Nikita Popov
217dfc0832 Accept null context in stream_socket_(client|server) 2020-04-09 16:10:27 +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
Tyson Andre
5624d2eb00 Make some opcache types consistent with reflection information
Remove functions such as filter_id() where reference counts and types are
identical to what's in opcache.

Remove null types from zend_func_info.c that aren't in Reflection
(php would throw now)

Fix the Reflection type information for assert_options()

    php > assert_options(ASSERT_CALLBACK, static function() {});
    php > var_export(assert_options(ASSERT_CALLBACK));
    Closure::__set_state(array(
    ))

Closes GH-4958.
2019-12-04 07:31:06 +01:00
Máté Kocsis
c58b12334d Add union return types with one class 2019-11-18 12:44:38 +01:00
Nikita Popov
292a1aeb59 Support union types for args in gen stubs
Using this requires care! The zpp implementation for this union
must be consistent with the arginfo implementation!

Apart from array|object, this is probably only the case for
int|float right now.
2019-11-15 17:33:37 +01:00
Nikita Popov
40dcf2bd3d password_hash() can't return false 2019-11-15 12:43:57 +01:00
Máté Kocsis
27e83d0fb8 Add union return types for function stubs 2019-11-11 14:54:55 +01:00
Nikita Popov
9bbbc9e7e9 Add support for union types in stubs
This is the MVP for supporting union types in PHP stubs. Return
types with only builtin types work, which is the part we mainly
need.

Closes GH-4895.
2019-11-08 17:32:18 +01:00
Máté Kocsis
ab6b412a0b Add stubs for standard lib functions 2019-11-07 17:59:03 +01:00
Máté Kocsis
14bdb0cfc7 Fix consistency issues with array accesses warnings/exceptions
* Change a number of "resource used as offset" notices to warnings,
   which were previously missed.
 * Throw the "resource used as offset" warning for isset() as well.
 * Make array_key_exists() behavior with regard to different key
   types consistent with isset() and normal array accesses. All key
   types now use the usual coercions and array/object keys throw
   TypeError.

Closes GH-4887.
2019-11-06 12:56:47 +01:00
Nikita Popov
93ba3abe63 Warn on strtr(["" => "x"])
Previously:
 * If only ["" => "x"] was present, the original string was returned
   without warning.
 * If both ["" => "x"] and at least one more element was present,
   false was returned without warning.

New behavior:
 * Ignore "" keys in the replacement array (and perform any remaining
   replacement).
 * Throw a warning indicating that an empty string replacement has
   been ignored.

Closes GH-4792.
2019-10-30 10:53:45 +01:00
Nikita Popov
becda2e041 Promote mt_rand() min/max warning to ValueError 2019-10-30 10:36:42 +01:00
Máté Kocsis
ad9ea5abde Add stubs for various standard functions
Closes GH-4851.
2019-10-30 10:34:06 +01:00
Máté Kocsis
fee94da127 Add stubs for directory and file functions 2019-10-30 10:10:40 +01:00
Colin O'Dell
e7335eb420 Allow array_splice() length to be null 2019-10-23 11:22:12 +02:00