Skip to content

Commit 725f0ef

Browse files
authored
Merge pull request #9 from php/master
sync
2 parents dd61db7 + 33e9049 commit 725f0ef

File tree

459 files changed

+25052
-5912
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

459 files changed

+25052
-5912
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,10 @@ jobs:
7070
include:
7171
- env: ENABLE_ZTS=0 ENABLE_DEBUG=0
7272
arch: amd64
73+
if: type = cron
7374
- env: ENABLE_ZTS=1 ENABLE_DEBUG=1
7475
arch: amd64
76+
if: type = cron
7577
- env: ENABLE_ZTS=1 ENABLE_DEBUG=1 SKIP_IO_CAPTURE_TESTS=1 ARM64=1
7678
arch: arm64
7779
if: type = cron

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33
?? ??? ????, PHP 8.1.0alpha1
44

5+
- Core:
6+
. Fixed inclusion order for phpize builds on Windows. (cmb)
7+
. Added missing hashtable insertion APIs for arr/obj/ref. (Sara)
8+
59
- FTP:
610
. Convert resource<ftp> to object \FTPConnection. (Sara)
711

UPGRADING

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,49 @@ PHP 8.1 UPGRADE NOTES
1919
1. Backward Incompatible Changes
2020
========================================
2121

22+
- MySQLi:
23+
. mysqli_fetch_fields() and mysqli_fetch_field_direct() will now always return
24+
zero for max_length. You can compute this information by iterating over the
25+
result set and taking the maximum length. This is what PHP was doing
26+
internally previously.
27+
. The MYSQLI_STMT_ATTR_UPDATE_MAX_LENGTH option no longer has an effect.
28+
. The MYSQLI_STORE_RESULT_COPY_DATA option no longer has an effect.
29+
30+
- MySQLnd:
31+
. The mysqlnd.fetch_copy_data ini setting has been removed. However, this
32+
should not result in user-visible behavior changes.
33+
34+
- Standard:
35+
. version_compare() no longer accepts undocumented operator abbreviations.
36+
2237
========================================
2338
2. New Features
2439
========================================
2540

2641
- hash:
27-
. Added MurmurHash3 with streaming support. The following variants are implemented
42+
. The following functions have changed signatures:
43+
44+
- function hash(string $algo, string $data, bool $binary = false, array $options = []): string|false {}
45+
- function hash_file(string $algo, string $filename, bool $binary = false, array $options = []): string|false {}
46+
- function hash_init(string $algo, int $flags = 0, string $key = "", array $options = []): HashContext {}
47+
48+
The additional `$options` argument can be used to pass algorithm specific data.
49+
50+
. Added MurmurHash3 with streaming support. The following variants are implemented:
2851

2952
- murmur3a, 32-bit hash
3053
- murmur3c, 128-bit hash for x86
3154
- murmur3f, 128-bit hash for x64
3255

56+
The initial hash state can be passed through the `seed` key in the `$options` array, for example:
57+
58+
```php
59+
$h = hash("murmur3f", $data, options: ["seed" => 42]);
60+
echo $h, "\n";
61+
```
62+
63+
A valid seed value is within the range from 0 to the plaform defined UINT_MAX, usually 4294967295.
64+
3365
========================================
3466
3. Changes in SAPI modules
3567
========================================
@@ -61,6 +93,11 @@ PHP 8.1 UPGRADE NOTES
6193
- OpenSSL:
6294
. The OpenSSL extension now requires at least OpenSSL version 1.0.2.
6395

96+
- Standard:
97+
. --with-password-argon2 now uses pkg-config to detect libargon2. As such,
98+
an alternative libargon2 location should now be specified using
99+
PKG_CONFIG_PATH.
100+
64101
========================================
65102
10. New Global Constants
66103
========================================

UPGRADING.INTERNALS

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ PHP 8.1 INTERNALS UPGRADE NOTES
55
2. Build system changes
66

77
3. Module changes
8+
a. ext/hash
89

910
========================
1011
1. Internal API changes
@@ -17,3 +18,10 @@ PHP 8.1 INTERNALS UPGRADE NOTES
1718
========================
1819
3. Module changes
1920
========================
21+
22+
a. ext/hash
23+
- The init signatures are extended with an additional `HashTable*`
24+
argument. The passed HT is to contain the algorithm specific
25+
configuration. If the an algorithm doesn't make use of any
26+
additional configuration, the argument is to be marked with
27+
ZEND_ATTRIBUTE_UNUSED.

Zend/Zend.m4

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -190,12 +190,6 @@ dnl LIBZEND_OTHER_CHECKS
190190
dnl
191191
AC_DEFUN([LIBZEND_OTHER_CHECKS],[
192192
193-
AC_ARG_ENABLE([zts],
194-
[AS_HELP_STRING([--enable-zts],
195-
[Enable thread safety])],
196-
[ZEND_ZTS=$enableval],
197-
[ZEND_ZTS=no])
198-
199193
AC_MSG_CHECKING(whether to enable thread-safety)
200194
AC_MSG_RESULT($ZEND_ZTS)
201195
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
--TEST--
2+
Validation for "Attribute" does not use a scope when evaluating constant ASTs
3+
--FILE--
4+
<?php
5+
#[Attribute(parent::x)]
6+
class x extends y {}
7+
?>
8+
--EXPECTF--
9+
Fatal error: Cannot access "parent" when no class scope is active in %s on line %d

Zend/tests/bug70630.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ $x = (new ReflectionFunction("substr"))->getClosure();
77
$x->call(new a);
88
?>
99
--EXPECTF--
10-
Warning: Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure() in %s on line %d
10+
Warning: Cannot rebind scope of closure created from function in %s on line %d

Zend/tests/bug70685.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ var_dump($c);
1818
Warning: Cannot bind method SplDoublyLinkedList::count() to object of class cls in %s on line %d
1919
NULL
2020

21-
Warning: Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure() in %s on line %d
21+
Warning: Cannot rebind scope of closure created from method in %s on line %d
2222
NULL

Zend/tests/bug80391.phpt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
--TEST--
2+
Iterable not covariant to mixed
3+
--FILE--
4+
<?php
5+
6+
class A {
7+
public function method1(): mixed {}
8+
public function method2(): array|object {}
9+
public function method3(iterable $x) {}
10+
public function method4(iterable $x) {}
11+
}
12+
13+
class B extends A {
14+
public function method1(): iterable {}
15+
public function method2(): iterable {}
16+
public function method3(mixed $x) {}
17+
public function method4(array|object $x) {}
18+
}
19+
20+
?>
21+
===DONE===
22+
--EXPECT--
23+
===DONE===

Zend/tests/bug80404.phpt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--TEST--
2+
Bug #80404: Incorrect range inference result when division results in float
3+
--FILE--
4+
<?php
5+
6+
$n = 63;
7+
var_dump((int) ($n / 120 * 100));
8+
9+
?>
10+
--EXPECT--
11+
int(52)

0 commit comments

Comments
 (0)