1
0
mirror of https://github.com/php/php-src.git synced 2026-04-21 15:08:16 +02:00
Commit Graph

118155 Commits

Author SHA1 Message Date
Tyson Andre 047d814704 Fix an undefined class error running gen_stub in php8
For whatever reason, php 8 would not have loaded the subsequent classes when
running `php build/gen_stub.php path/to/filename.php`.
I assume it didn't load the classes immediately because there's a possibility
the code before it would throw.
(Probably because __toString was added recently and prevents early binding)

Also, fix a typo

Closes GH-5369
2020-04-11 17:17:28 -04:00
Máté Kocsis 7b2a8a6dda Lowercase NULL to null in stubs 2020-04-11 14:13:11 +02:00
Máté Kocsis 3fe49d81f8 Generate method entries from stubs for a couple of extensions
Closes GH-5368
2020-04-11 13:28:53 +02:00
Máté Kocsis ca006e54e3 Add missing visibility modifiers in stubs 2020-04-11 10:23:51 +02:00
Máté Kocsis 1d05771a70 Add support for generating method entries from stubs
Closes GH-5363
2020-04-11 09:15:14 +02:00
Máté Kocsis fe9860c2b0 Improve the default value format in incompatible signature error messages
Closes GH-5361
2020-04-10 22:50:33 +02:00
Máté Kocsis 4aa137c6a6 Fix the default value of the $length parameter of grapheme_substr() 2020-04-10 18:17:18 +02:00
Máté Kocsis ce3b49a8e8 Fix default value of the $class_name parameter of mysqli_fetch_object() 2020-04-10 18:17:18 +02:00
Máté Kocsis 7a72e1cc7a Fix the default value of the $flags parameter of mysqli_begin_transaction() 2020-04-10 18:17:18 +02:00
Máté Kocsis 481c8c2958 Add missing parameter to the stub of mysqli_real_connect 2020-04-10 18:17:18 +02:00
George Peter Banyard 3eba187b15 Refactor and remove dead code in mb_ereg(i)_replace
We do not support the 'e' option anymore.
Merged together code which would emit an error if this option is present.
This also makes it clearer that the whole branch in the replacement section supporting this option is never hit, thus removed.
2020-04-10 17:56:05 +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
Máté Kocsis 5868aced2e Fix the default parameter values of session_set_save_handler()
Co-Authored-By: Christoph M. Becker <cmbecker69@gmx.de>
2020-04-10 17:07:26 +02:00
Dmitry Stogov 0a408be0d2 Separate zend_jit_dump_lifetime_interval() function 2020-04-10 16:10:19 +03:00
Dmitry Stogov d3dda1e0f1 Fixed overflow handling 2020-04-10 14:42:26 +03:00
Dmitry Stogov 66f2ebe448 Register allocator refactoring 2020-04-09 19:31:18 +03: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 c10f30fdf9 Mark spl_autoload_register function arg as UNKNOWN
Not passing any parameters to this function has magic behavior.
2020-04-09 16:54:40 +02:00
Nikita Popov 8a5b9cbc9f Fix mysqli_get_client_info() stub
The dummy link argument is not nullable.
2020-04-09 16:54:39 +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 2d1bf6970d Add Z_PARAM_RESOURCE_OR_NULL()
As a more explicit alternative to Z_PARAM_RESOURCE_EX(, 1, 0).
2020-04-09 15:39:11 +02:00
Nikita Popov d030ddb2cd Export the zend_string_concat3() API 2020-04-09 15:06:53 +02:00
Nikita Popov 696ae335e3 Export API for fetching internal func default
Make this functionality available outside reflection.
2020-04-09 14:55:55 +02:00
Christoph M. Becker 175e5ed4bf Fix typo (UNKOWN -> UNKNOWN) 2020-04-09 14:06:11 +02:00
George Peter Banyard 12ec7a2730 Convert if blocks to assertions and adapt stubs accordingly 2020-04-09 13:50:37 +02:00
George Peter Banyard 73455778d4 Cache MBFL encoding for Oniguruma regex functions.
Closes GH-5355
2020-04-09 13:48:55 +02:00
Dmitry Stogov 41c2b275f7 cleanup 2020-04-09 14:33:29 +03:00
Dmitry Stogov ba64b3fd41 Don't get number of passed arguments from "fake" INIT frames 2020-04-09 13:38:40 +03:00
Christoph M. Becker e6458d67cf Fix #79462: method_exists and property_exists incoherent behavior
Both functions are closely related, so should behave the same for wrong
input types, i.e. both should throw a TypeError.
2020-04-09 11:38:47 +02:00
Nikita Popov 12324364f7 Add test to make sure internal param default eval doesn't error 2020-04-09 11:22:55 +02:00
Nikita Popov 8ba6a833de Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #78434
2020-04-09 10:35:50 +02:00
Nikita Popov 823a956855 Fixed bug #78434
The DO_INIT flag, which will skip the first resume on a primed
generator, should always be set when starting to yield from a
new generator, not only when the yield from happens during priming.
2020-04-09 10:33:11 +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 b0d8f012f9 Merge branch 'PHP-7.4'
* PHP-7.4:
  Add php_cli_server_connect() helper
2020-04-08 17:11:50 +02:00
Nikita Popov 1327491224 Add php_cli_server_connect() helper
To encapsulate the repeated fsockopen() code.

This gives us a chance to control the timeout in one place:
Raise it to one second.
2020-04-08 17:10:20 +02:00
Nikita Popov 5293c6d6d4 Merge branch 'PHP-7.4'
* PHP-7.4:
  Make mysqli_poll test more deterministic
2020-04-08 16:38:18 +02:00
Nikita Popov 5317ea6d57 Make mysqli_poll test more deterministic
Handle errors appearing in different order.
2020-04-08 16:36:22 +02:00
Nikita Popov 3ea94ed78e Fix typo in GD stub 2020-04-08 12:03:14 +02:00
Nikita Popov 38d93262a0 Update mb_strrpos() stub
We no longer accept the encoding as 3rd param, so we can make this
a proper int argument.
2020-04-08 12:03:14 +02:00
Dmitry Stogov 3042b2b201 Dump information about trace side exits 2020-04-08 12:39:24 +03:00
Christoph M. Becker 6a67067c21 Merge branch 'PHP-7.4'
* PHP-7.4:
  Relax overly strict test expectation
2020-04-08 11:35:28 +02:00
Christoph M. Becker 73a0719f45 Relax overly strict test expectation
There is no reason to expect a `1` after the PID; neither the session
ID nor the memory usage are required to contain one.  Actually, we just
want to verify here, that the process with the $child_pid is running,
and is a php.exe process.
2020-04-08 11:34:18 +02:00
Christoph M. Becker d4f9d54f1a Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix memory leak introduced by fixing bug #78221
2020-04-08 10:37:28 +02:00
Christoph M. Becker c3ee9d1bb7 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix memory leak introduced by fixing bug #78221
2020-04-08 10:36:57 +02:00