1
0
mirror of https://github.com/php/php-src.git synced 2026-04-25 17:08:14 +02:00
Commit Graph

125576 Commits

Author SHA1 Message Date
Dmitry Stogov 7fcb45dffa JIT: prefer string reallocation instead of allocation/memcpy/deallocation 2021-09-07 15:28:15 +03:00
Dmitry Stogov aed94e2ca8 JIT: improved code for protected properties access 2021-09-07 13:18:14 +03:00
Dmitry Stogov 1bb6cf5396 JIT: eliminate check for undefined constant if there is a persistent constant 2021-09-07 13:17:16 +03:00
Dmitry Stogov d4ed6b635f JIT: Update run_time_cache slot in zend_jit_find_func helper 2021-09-07 13:13:47 +03:00
Máté Kocsis c8f858ef49 Add more specific array return type hints for various extensions - part 4 (#7469) 2021-09-06 17:14:52 +02:00
Máté Kocsis 6a47831e6e Add more specific array return type hints for various extensions - part 3 (#7467) 2021-09-06 12:27:28 +02:00
Máté Kocsis a55c6384dc Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix the return type of ftp_raw()
2021-09-06 10:29:24 +02:00
Máté Kocsis 4b3206d6c1 Fix the return type of ftp_raw() (#7466) 2021-09-06 10:26:01 +02:00
Máté Kocsis d670d9335c Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix default value of $flags in idn_to_ascii() and idn_to_utf8()
2021-09-04 17:57:23 +02:00
Máté Kocsis d5aed7b0e3 Fix default value of $flags in idn_to_ascii() and idn_to_utf8() 2021-09-04 16:42:28 +02:00
Derick Rethans a6d50d21d9 Fixed typo 2021-09-03 18:21:10 +01:00
Tyson Andre 4c48fd22d7 Fix inconsistency in true/false/null constant resolution when opcache is not used (#7441)
Strangely, uses of eval and 'php -a' (or loading a file without opcache after a namespaced constant was declared)
will not treat non-FQ true/false/null as magic keywords, while compiled php required from a file would do that.

This may confuse people learning the language, and result in code loaded with
eval() behaving differently from the same snippet in a file loaded by require.

```
Interactive shell

php > define('foo\true', 'test');
php > namespace foo { var_dump(true); }
string(4) "test"
```

This will make the same session instead properly emit `bool(true);` like it
already would if running those statements in files when opcache was used.
2021-09-03 08:42:36 -04:00
Nikita Popov 3eeeeeb104 Fully qualify ReturnTypeWillChange in deprecation message
When adding the #[ReturnTypeWillChange] attribute in namespaced
code, you also need to use ReturnTypeWillChange, otherwise it
will be silently ignored and may result in confusion. Change the
deprecation message to suggest #[\ReturnTypeWillChange], which
will always work.

Closes GH-7454.
2021-09-03 13:57:23 +02:00
Christoph M. Becker cb5a4ed920 Use --EXTENSIONS-- section for new test 2021-09-02 23:49:05 +02:00
Christoph M. Becker 404bed1a69 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix #81407: shmop_open won't attach and causes php to crash
2021-09-02 23:21:22 +02:00
Christoph M. Becker 58ad403cec Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #81407: shmop_open won't attach and causes php to crash
2021-09-02 23:18:53 +02:00
Christoph M. Becker f3d24af74f Fix #81407: shmop_open won't attach and causes php to crash
We need to allocate buffers for the file mapping names which are large
enough for all potential keys (`key_t` is defined as `int` on Windows).

Regarding the test: it's probably never a good idea to use hard-coded
keys (should always use `ftok()` instead), but to reliably reproduce
this Windows specific issue we need to, and it shouldn't be an issue on
that OS.

Closes GH-7448.
2021-09-02 23:16:48 +02:00
Máté Kocsis 805f2b9803 Fix forgotten test 2021-09-02 17:44:52 +02:00
Máté Kocsis 194f1f095f Revert unintended tentative return type change
I accidentally made the return type of all Reflection*::getAttributes() methods tentative, even though they have already been declared natively.
2021-09-02 17:06:19 +02:00
Máté Kocsis 4483ecf5a9 Properly escape the default value of string properties and enum cases 2021-09-02 16:53:31 +02:00
Dmitry Stogov cbc925e510 Fixed bug #81409 (Incorrect JIT code for ADD with a reference to array) 2021-09-02 11:13:27 +03:00
Patrick Allaert d6d6491153 Preparing for 8.1.0RC2 2021-09-01 18:22:32 +02:00
Dmitry Stogov 66f8866a62 JIT: Fixed call to zend_free_compiled_variables() 2021-09-01 19:10:54 +03:00
Remi Collet e9228a6a39 NEWS 2021-09-01 15:52:12 +02:00
Remi Collet d515979b34 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  NEWS + bump zip version
  Fix #80833 ZipArchive::getStream doesn't use setPassword
2021-09-01 15:51:37 +02:00
Remi Collet fde24e4db0 NEWS + bump zip version 2021-09-01 15:51:24 +02:00
Remi Collet a6ffd8d1e9 Fix #80833 ZipArchive::getStream doesn't use setPassword 2021-09-01 15:49:46 +02:00
Dmitry Stogov c7fdf9c139 Avoid class name validation if it's already have IS_STR_CLASS_NAME_MAP_PTR flag. 2021-09-01 16:02:11 +03:00
Nikita Popov 1e012ecb3f Fix bug #81405: Restore old PDO::PARAM_* values
Doctrine hardcodes the values of these constants, avoid changing
them.

Closes GH-7445.
2021-09-01 13:54:41 +02:00
Nikita Popov 16112a54fa Add PHP-8.1 to scheduled builds as well
[ci skip]
2021-09-01 10:03:08 +02:00
Nikita Popov c4d72cea5c Add PHP-8.1 to azure pipelines 2021-09-01 09:57:11 +02:00
Nikita Popov 27901e0f6a Restore dev version 2021-09-01 09:56:54 +02:00
Patrick Allaert 5764414eb8 Prepare for PHP 8.1.0RC1 2021-08-31 18:57:44 +02:00
Derick Rethans b0dd55b11c Fixed test - the expected result was wrong 2021-08-31 17:19:28 +01:00
Nikita Popov 5adfcfe746 Merge branch 'PHP-8.0'
* PHP-8.0:
  Avoid dangling pointer in curl header.str
2021-08-31 17:25:38 +02:00
Nikita Popov db055fdb89 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Avoid dangling pointer in curl header.str
2021-08-31 17:24:30 +02:00
Alexey Zamorov 8c292a2f9d Avoid dangling pointer in curl header.str
If buf_len is zero, this would leave behind a dangling pointer
to an already released header.str. Make sure this can't happen
by always overwriting the pointer.

Closes GH-7376.
2021-08-31 17:23:58 +02:00
Nikita Popov 4ba7e5b24d Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix curl_copy_handle() with CURLINFO_HEADER_OUT
2021-08-31 17:09:34 +02:00
Nikita Popov 416dd524f9 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix curl_copy_handle() with CURLINFO_HEADER_OUT
2021-08-31 17:09:07 +02:00
Nikita Popov 30e791ed56 Fix curl_copy_handle() with CURLINFO_HEADER_OUT
The CURLOPT_DEBUGDATA will point to the old curl handle after
copying. Update it to point to the new handle.

We don't separately store whether CURLINFO_HEADER_OUT is enabled,
so I'm doing this unconditionally. It should be harmless if
CURLOPT_DEBUGFUNCTION is not used.
2021-08-31 17:06:41 +02:00
Nikita Popov 992b5f2e08 Make it easier to run curl tests standalone
Fall back to PHP_BINARY if TEST_PHP_EXECUTABLE not given.
2021-08-31 16:53:43 +02:00
Derick Rethans 2bf451b925 Upgrade timelib to 2021.08, which address some defects and performance
- Fixed bug #80998 (Missing second with inverted interval).
- Speed up finding timezone offset information.
2021-08-31 15:29:48 +01:00
Nikita Popov 14f599ea7d Use zend_long for resource ID
Currently, resource IDs are limited to 32-bits. As resource IDs
are not reused, this means that resource ID overflow for
long-running processes is very possible.

This patch switches resource IDs to use zend_long instead, which
means that on 64-bit systems, 64-bit resource IDs will be used.
This makes resource ID overflow practically impossible.

The tradeoff is an 8 byte increase in zend_resource size.

Closes GH-7436.
2021-08-31 14:58:59 +02:00
Nikita Popov 9b170a41a7 Mark private function as static 2021-08-31 14:54:02 +02:00
Máté Kocsis edf2947a5d Remove unused variable from property generation code 2021-08-31 14:44:41 +02:00
Máté Kocsis 39ede67e17 Fix typo in method name in gen_stub.php 2021-08-31 14:43:11 +02:00
Dmitry Stogov 6871a49b66 Fix timelib_parse_zone() performance problem.
This makes "new DateTimeZone("Europe/London");" 170 times faster.

This is a hotfix for https://github.com/derickr/timelib/pull/99
2021-08-31 15:29:05 +03:00
Nikita Popov 32d48212ea Support generating internal enum decl from stubs 2021-08-31 14:19:37 +02:00
Alex Dowad df32267494 Add more tests for UTF7-IMAP text conversion 2021-08-31 13:41:34 +02:00
Alex Dowad 16a1e0a219 In UTF7-IMAP, reject the 2nd part of surrogate pair if it appears unexpectedly 2021-08-31 13:41:34 +02:00