Skip to content

Commit 02d022a

Browse files
authored
Merge pull request #18 from php/master
mege
2 parents bda9813 + 9683812 commit 02d022a

File tree

84 files changed

+12616
-10402
lines changed

Some content is hidden

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

84 files changed

+12616
-10402
lines changed

NEWS

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,13 @@ PHP NEWS
1313

1414
- Curl:
1515
. Added support for CURLOPT_XFERINFOFUNCTION. (David Carlier)
16+
. Added support for CURLOPT_MAXFILESIZE_LARGE. (David Carlier)
1617

1718
- Date:
1819
. Fixed GH-8458 (DateInterval::createFromDateString does not throw if
1920
non-relative items are present). (Derick)
21+
. Fixed bug #52015 (Allow including end date in DatePeriod iterations)
22+
(Daniel Egeberg, Derick)
2023
. idate() now accepts format specifiers "N" (ISO Day-of-Week) and "o" (ISO
2124
Year). (Pavel Djundik)
2225

@@ -44,31 +47,38 @@ PHP NEWS
4447
. Added ReflectionFunction::isAnonymous(). (Nicolas Grekas)
4548
. Added ReflectionMethod::hasPrototype(). (Ollie Read)
4649

50+
- Session:
51+
. Fixed bug GH-7787 (Improve session write failure message for user error
52+
handlers). (ilutov)
53+
54+
- Sockets:
55+
. Added TCP_NOTSENT_LOWAT socket option. (David Carlier)
56+
. Added SO_MEMINFO socket option. (David Carlier)
57+
4758
- Sodium:
4859
. Added sodium_crypto_stream_xchacha20_xor_ic(). (Scott)
4960

5061
- SQLite3:
5162
. Changed sqlite3.defensive from PHP_INI_SYSTEM to PHP_INI_USER. (bohwaz)
5263

53-
- Streams:
54-
. Set IP_BIND_ADDRESS_NO_PORT if available when connecting to remote host.
55-
(Cristian Rodríguez)
56-
5764
- Standard:
5865
. net_get_interfaces() also reports wireless network interfaces on Windows.
5966
(Yurun)
6067
. Finished AVIF support in getimagesize(). (Yannis Guyon)
6168
. Fixed bug GH-7847 (stripos with large haystack has bad performance).
6269
(ilutov)
6370
. New function memory_reset_peak_usage(). (Patrick Allaert)
71+
. Fixed parse_url(): can not recognize port without scheme. (pandaLIU)
72+
73+
- Streams:
74+
. Set IP_BIND_ADDRESS_NO_PORT if available when connecting to remote host.
75+
(Cristian Rodríguez)
6476

6577
- Zip:
6678
. add ZipArchive::clearError() method
6779
. add ZipArchive::getStreamName() method
6880
. add ZipArchive::getStreamIndex() method
69-
70-
- Session:
71-
. Fixed bug GH-7787 (Improve session write failure message for user error
72-
handlers). (ilutov)
81+
. On Windows, the Zip extension is now built as shared library (DLL) by
82+
default. (cmb)
7383

7484
<<< NOTE: Insert NEWS from last stable release here prior to actual release! >>>

UPGRADING

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,12 @@ PHP 8.2 UPGRADE NOTES
199199

200200
- Curl:
201201
. CURLOPT_XFERINFOFUNCTION
202+
. CURLOPT_MAXFILESIZE_LARGE
202203

203204
- Sockets:
204205
. SO_INCOMING_CPU
206+
. TCP_NOTSENT_LOWAT
207+
. SO_MEMINFO
205208

206209
========================================
207210
11. Changes to INI File Handling
@@ -220,6 +223,9 @@ PHP 8.2 UPGRADE NOTES
220223
the configuration option --with-oci8 has been dropped. --with-oci8-11g,
221224
--with-oci8-12c and --with-oci8-19 are still supported.
222225

226+
- Zip:
227+
. The Zip extension is now built as shared library (DLL) by default.
228+
223229
========================================
224230
13. Other Changes
225231
========================================

UPGRADING.INTERNALS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ PHP 8.2 INTERNALS UPGRADE NOTES
3434
string_natural_case_compare_function(), and string_natural_compare_function()
3535
have been removed. They always returned SUCCESS and were a wrapper around
3636
strnatcmp_ex(). Use strnatcmp_ex() directly instead.
37+
b. ext/pdo
38+
- pdo_raise_impl_error()'s parameter sqlstate has been changed from
39+
const char * to pdo_error_type (aka char [6]).
3740

3841
========================
3942
4. OpCode changes

Zend/Optimizer/sccp.c

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2067,8 +2067,39 @@ static int try_remove_definition(sccp_ctx *ctx, int var_num, zend_ssa_var *var,
20672067
}
20682068
return 0;
20692069
}
2070-
if (ssa_op->op1_def >= 0
2071-
|| ssa_op->op2_def >= 0) {
2070+
if (ssa_op->op1_def >= 0 || ssa_op->op2_def >= 0) {
2071+
if (var->use_chain < 0 && var->phi_use_chain == NULL) {
2072+
switch (opline->opcode) {
2073+
case ZEND_ASSIGN:
2074+
case ZEND_ASSIGN_REF:
2075+
case ZEND_ASSIGN_DIM:
2076+
case ZEND_ASSIGN_OBJ:
2077+
case ZEND_ASSIGN_OBJ_REF:
2078+
case ZEND_ASSIGN_STATIC_PROP:
2079+
case ZEND_ASSIGN_STATIC_PROP_REF:
2080+
case ZEND_ASSIGN_OP:
2081+
case ZEND_ASSIGN_DIM_OP:
2082+
case ZEND_ASSIGN_OBJ_OP:
2083+
case ZEND_ASSIGN_STATIC_PROP_OP:
2084+
case ZEND_PRE_INC:
2085+
case ZEND_PRE_DEC:
2086+
case ZEND_PRE_INC_OBJ:
2087+
case ZEND_PRE_DEC_OBJ:
2088+
case ZEND_DO_ICALL:
2089+
case ZEND_DO_UCALL:
2090+
case ZEND_DO_FCALL_BY_NAME:
2091+
case ZEND_DO_FCALL:
2092+
case ZEND_INCLUDE_OR_EVAL:
2093+
case ZEND_YIELD:
2094+
case ZEND_YIELD_FROM:
2095+
case ZEND_ASSERT_CHECK:
2096+
opline->result_type = IS_UNUSED;
2097+
zend_ssa_remove_result_def(ssa, ssa_op);
2098+
break;
2099+
default:
2100+
break;
2101+
}
2102+
}
20722103
/* we cannot remove instruction that defines other variables */
20732104
return 0;
20742105
} else if (opline->opcode == ZEND_JMPZ_EX

Zend/Optimizer/zend_inference.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2708,8 +2708,8 @@ static zend_always_inline zend_result _zend_update_type_info(
27082708
tmp |= MAY_BE_NULL|MAY_BE_FALSE|MAY_BE_TRUE|MAY_BE_LONG|MAY_BE_DOUBLE|MAY_BE_STRING;
27092709
}
27102710
}
2711-
if (!tmp) {
2712-
tmp = MAY_BE_NULL;
2711+
if (t1 & (MAY_BE_TRUE|MAY_BE_LONG|MAY_BE_DOUBLE|MAY_BE_RESOURCE)) {
2712+
tmp |= MAY_BE_NULL;
27132713
}
27142714
tmp |= MAY_BE_RC1 | MAY_BE_RCN;
27152715
UPDATE_SSA_TYPE(tmp, ssa_op->result_def);
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
--TEST--
2+
The readonly class modifier can only be added once
3+
--FILE--
4+
<?php
5+
6+
readonly readonly class Foo
7+
{
8+
}
9+
10+
?>
11+
--EXPECTF--
12+
Fatal error: Multiple readonly modifiers are not allowed in %s on line %d
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
--TEST--
2+
Readonly classes cannot use dynamic properties
3+
--FILE--
4+
<?php
5+
6+
readonly class Foo
7+
{
8+
}
9+
10+
$foo = new Foo();
11+
12+
try {
13+
$foo->bar = 1;
14+
} catch (Error $exception) {
15+
echo $exception->getMessage() . "\n";
16+
}
17+
18+
?>
19+
--EXPECT--
20+
Cannot create dynamic property Foo::$bar
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
--TEST--
2+
Readonly classes cannot apply the #[AllowDynamicProperties] attribute
3+
--FILE--
4+
<?php
5+
6+
#[AllowDynamicProperties]
7+
readonly class Foo
8+
{
9+
}
10+
11+
?>
12+
--EXPECTF--
13+
Fatal error: Cannot apply #[AllowDynamicProperties] to readonly class Foo in %s on line %d
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
--TEST--
2+
The readonly and final class modifiers can be defined in the same time
3+
--FILE--
4+
<?php
5+
6+
final readonly class Foo
7+
{
8+
}
9+
10+
readonly class Bar extends Foo
11+
{
12+
}
13+
14+
?>
15+
--EXPECTF--
16+
Fatal error: Class Bar cannot extend final class Foo in %s on line %d
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
--TEST--
2+
Non-readonly class cannot extend a readonly class
3+
--FILE--
4+
<?php
5+
6+
readonly class Foo
7+
{
8+
}
9+
10+
class Bar extends Foo
11+
{
12+
}
13+
14+
?>
15+
--EXPECTF--
16+
Fatal error: Non-readonly class Bar cannot extend readonly class Foo in %s on line %d

0 commit comments

Comments
 (0)