Skip to content

Commit 70892a7

Browse files
Merge branch 'php:master' into master
2 parents e649783 + 9788244 commit 70892a7

File tree

92 files changed

+1260
-236
lines changed

Some content is hidden

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

92 files changed

+1260
-236
lines changed

.github/nightly_matrix.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,5 +88,7 @@ function get_matrix_include(array $branches) {
8888
$branches = get_branches();
8989
$matrix_include = get_matrix_include($branches);
9090

91-
echo '::set-output name=branches::' . json_encode($branches, JSON_UNESCAPED_SLASHES) . "\n";
92-
echo '::set-output name=matrix-include::' . json_encode($matrix_include, JSON_UNESCAPED_SLASHES) . "\n";
91+
$f = fopen(getenv('GITHUB_OUTPUT'), 'a');
92+
fwrite($f, 'branches=' . json_encode($branches, JSON_UNESCAPED_SLASHES) . "\n");
93+
fwrite($f, 'matrix-include=' . json_encode($matrix_include, JSON_UNESCAPED_SLASHES) . "\n");
94+
fclose($f);

NEWS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ PHP NEWS
4747
. mb_detect_encoding's "non-strict" mode now behaves as described in the
4848
documentation. Previously, it would return false if the very first byte
4949
of the input string was invalid in all candidate encodings. (Alex Dowad)
50+
. mb_strtolower, mb_strtotitle, and mb_convert_case implement conditional
51+
casing rules for the Greek letter sigma. For mb_convert_case, conditional
52+
casing only applies to MB_CASE_LOWER and MB_CASE_TITLE modes, not to
53+
MB_CASE_LOWER_SIMPLE and MB_CASE_TITLE_SIMPLE. (Alex Dowad)
5054

5155
- Opcache:
5256
. Added start, restart and force restart time to opcache's
@@ -65,6 +69,7 @@ PHP NEWS
6569
- Posix:
6670
. Added posix_sysconf. (David Carlier)
6771
. Added posix_pathconf. (David Carlier)
72+
. Added posix_fpathconf. (David Carlier)
6873

6974
- Random:
7075
. Added Randomizer::getBytesFromString(). (Joshua Rüsweg)
@@ -81,6 +86,7 @@ PHP NEWS
8186
. Added socket_atmark if send/recv needs using MSG_OOB. (David Carlier)
8287
. Added TCP_QUICKACK constant, to give tigher control over
8388
ACK delays. (David Carlier)
89+
. Added DONTFRAGMENT support for path MTU discovery purpose. (David Carlier)
8490

8591
- Standard:
8692
. E_NOTICEs emitted by unserialize() have been promoted to E_WARNING. (timwolla)

UPGRADING

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ PHP 8.3 UPGRADE NOTES
5656
"buffer_size" => int
5757
See GH-9336
5858

59+
- MBString:
60+
. mb_strtolower, mb_strtotitle, and mb_convert_case implement conditional
61+
casing rules for the Greek letter sigma. For mb_convert_case, conditional
62+
casing only applies to MB_CASE_LOWER and MB_CASE_TITLE modes, not to
63+
MB_CASE_LOWER_SIMPLE and MB_CASE_TITLE_SIMPLE. (Alex Dowad)
64+
5965
- Standard:
6066
. E_NOTICEs emitted by unserialized() have been promoted to E_WARNING.
6167
RFC: https://wiki.php.net/rfc/improve_unserialize_error_handling
@@ -72,6 +78,7 @@ PHP 8.3 UPGRADE NOTES
7278
- Posix:
7379
. Added posix_sysconf call to get runtime informations.
7480
. Added posix_pathconf call to get configuration value from a directory/file.
81+
. Added posix_fpathconf call to get configuration value from a file descriptor.
7582

7683
- Random:
7784
. Added Randomizer::getBytesFromString().
@@ -110,6 +117,14 @@ PHP 8.3 UPGRADE NOTES
110117
- Sockets:
111118
. SO_ATTACH_REUSEPORT_CBPF (Linux only).
112119
. TCP_QUICKACK (Linux only).
120+
. IP_DONTFRAG (FreeBSD only).
121+
. IP_MTU_DISCOVER (Linux only).
122+
. IP_PMTUDISC_DO (Linux only).
123+
. IP_PMTUDISC_DONT (Linux only).
124+
. IP_PMTUDISC_WANT (Linux only).
125+
. IP_PMTUDISC_PROBE (Linux only).
126+
. IP_PMTUDISC_INTERFACE (Linux only).
127+
. IP_PMTUDISC_OMIT (Linux only).
113128

114129
========================================
115130
11. Changes to INI File Handling

UPGRADING.INTERNALS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ PHP 8.3 INTERNALS UPGRADE NOTES
2626
break the build of third-party extensions which relied on this
2727
implementation detail. Those extensions may need to add the missing
2828
#include lines.
29+
* Since version 8, PHP requires a C99 compiler. Configure-time checks
30+
for C99 features have been removed and therefore macro definitions
31+
from php_config.h have disappeared. Do not use those feature
32+
macros.
2933

3034
========================
3135
2. Build system changes

Zend/Optimizer/dce.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "Optimizer/zend_ssa.h"
2323
#include "Optimizer/zend_func_info.h"
2424
#include "Optimizer/zend_call_graph.h"
25+
#include "zend_arena.h"
2526
#include "zend_bitset.h"
2627

2728
/* This pass implements a form of dead code elimination (DCE). The algorithm optimistically assumes

Zend/Optimizer/sccp.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@
1818
*/
1919

2020
#include "zend_API.h"
21+
#include "zend_arena.h"
22+
#include "zend_multiply.h" // for zend_safe_address_guarded()
2123
#include "zend_exceptions.h"
2224
#include "zend_ini.h"
25+
#include "zend_optimizer.h"
2326
#include "zend_type_info.h"
2427
#include "Optimizer/zend_optimizer_internal.h"
2528
#include "Optimizer/zend_call_graph.h"

Zend/Optimizer/scdf.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616
+----------------------------------------------------------------------+
1717
*/
1818

19-
#include "Optimizer/zend_optimizer_internal.h"
2019
#include "Optimizer/scdf.h"
20+
#include "Optimizer/zend_optimizer_internal.h"
21+
#include "zend_arena.h"
2122

2223
/* This defines a generic framework for sparse conditional dataflow propagation. The algorithm is
2324
* based on "Sparse conditional constant propagation" by Wegman and Zadeck. We're using a

Zend/Optimizer/scdf.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@
2020
#define _SCDF_H
2121

2222
#include "zend_bitset.h"
23+
#include "zend_long.h"
24+
#include "zend_ssa.h"
25+
26+
typedef struct _zend_op_array zend_op_array;
27+
typedef struct _zend_optimizer_ctx zend_optimizer_ctx;
2328

2429
typedef struct _scdf_ctx {
2530
zend_op_array *op_array;

Zend/Optimizer/zend_call_graph.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,11 @@
1616
+----------------------------------------------------------------------+
1717
*/
1818

19-
#include "zend_compile.h"
20-
#include "zend_extensions.h"
21-
#include "Optimizer/zend_optimizer.h"
22-
#include "zend_optimizer_internal.h"
23-
#include "zend_inference.h"
2419
#include "zend_call_graph.h"
20+
#include "zend_arena.h"
21+
#include "zend_bitset.h"
2522
#include "zend_func_info.h"
26-
#include "zend_inference.h"
27-
#include "zend_call_graph.h"
23+
#include "zend_optimizer_internal.h"
2824

2925
static void zend_op_array_calc(zend_op_array *op_array, void *context)
3026
{

Zend/Optimizer/zend_call_graph.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@
2020
#define ZEND_CALL_GRAPH_H
2121

2222
#include "zend_ssa.h"
23-
#include "zend_func_info.h"
24-
#include "zend_optimizer.h"
23+
24+
typedef struct _zend_func_info zend_func_info;
25+
typedef struct _zend_call_info zend_call_info;
2526

2627
typedef struct _zend_send_arg_info {
2728
zend_op *opline;

Zend/Optimizer/zend_cfg.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,12 @@
1616
+----------------------------------------------------------------------+
1717
*/
1818

19-
#include "zend_compile.h"
2019
#include "zend_cfg.h"
21-
#include "zend_func_info.h"
22-
#include "zend_worklist.h"
23-
#include "zend_optimizer.h"
20+
#include "zend_func_info.h" // for ZEND_FUNC_FREE_LOOP_VAR
21+
#include "zend_globals.h" // struct _zend_executor_globals
22+
#include "zend_globals_macros.h" // for EG()
2423
#include "zend_optimizer_internal.h"
25-
#include "zend_sort.h"
24+
#include "zend_worklist.h"
2625

2726
static void zend_mark_reachable(zend_op *opcodes, zend_cfg *cfg, zend_basic_block *b) /* {{{ */
2827
{

Zend/Optimizer/zend_cfg.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@
1919
#ifndef ZEND_CFG_H
2020
#define ZEND_CFG_H
2121

22+
#include "zend_portability.h" // for BEGIN_EXTERN_C
23+
24+
#include <stdint.h>
25+
26+
typedef struct _zend_arena zend_arena;
27+
typedef struct _zend_op_array zend_op_array;
28+
2229
/* zend_basic_block.flags */
2330
#define ZEND_BB_START (1<<0) /* first block */
2431
#define ZEND_BB_FOLLOW (1<<1) /* follows the next block */

Zend/Optimizer/zend_inference.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@
1616
+----------------------------------------------------------------------+
1717
*/
1818

19-
#include "zend_compile.h"
20-
#include "zend_generators.h"
2119
#include "zend_inference.h"
20+
#include "zend_closures.h" // for zend_ce_closure
21+
#include "zend_generators.h" // for zend_ce_generator
2222
#include "zend_func_info.h"
23+
#include "zend_globals.h" // struct _zend_executor_globals
24+
#include "zend_globals_macros.h" // for EG()
2325
#include "zend_call_graph.h"
24-
#include "zend_closures.h"
2526
#include "zend_worklist.h"
27+
#include "zend_optimizer.h"
2628
#include "zend_optimizer_internal.h"
2729

2830
/* The used range inference algorithm is described in:

Zend/Optimizer/zend_inference.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,11 @@
1919
#ifndef ZEND_INFERENCE_H
2020
#define ZEND_INFERENCE_H
2121

22-
#include "zend_optimizer.h"
22+
#include "zend_cfg.h" // for CRT_CONSTANT()
23+
#include "zend_compile.h" // for struct _zend_op
24+
#include "zend_portability.h" // for BEGIN_EXTERN_C
2325
#include "zend_ssa.h"
24-
#include "zend_bitset.h"
25-
26-
/* Bitmask for type inference (zend_ssa_var_info.type) */
27-
#include "zend_type_info.h"
26+
#include "zend_type_info.h" // for MAY_BE_*
2827

2928
#define MAY_BE_PACKED_GUARD (1<<27) /* needs packed array guard */
3029
#define MAY_BE_CLASS_GUARD (1<<27) /* needs class guard */

Zend/Optimizer/zend_optimizer.c

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,16 @@
2121

2222
#include "Optimizer/zend_optimizer.h"
2323
#include "Optimizer/zend_optimizer_internal.h"
24-
#include "zend_API.h"
25-
#include "zend_constants.h"
26-
#include "zend_execute.h"
27-
#include "zend_vm.h"
28-
#include "zend_cfg.h"
29-
#include "zend_func_info.h"
30-
#include "zend_call_graph.h"
31-
#include "zend_inference.h"
32-
#include "zend_dump.h"
33-
#include "php.h"
24+
#include "php_globals.h" // for PG()
25+
#include "zend_API.h" // for ZVAL_EMPTY_STRING()
26+
#include "zend_arena.h"
27+
#include "zend_call_graph.h" // for struct _zend_func_info
28+
#include "zend_dump.h" // for zend_dump_op_array()
29+
#include "zend_inference.h" // for OP1_INFO(), ...
30+
#include "zend_ini.h"
3431
#include "zend_observer.h"
32+
#include "zend_virtual_cwd.h" //for IS_ABSOLUTE_PATH()
33+
#include "zend_vm.h"
3534

3635
#ifndef ZEND_OPTIMIZER_MAX_REGISTERED_PASSES
3736
# define ZEND_OPTIMIZER_MAX_REGISTERED_PASSES 32

Zend/Optimizer/zend_optimizer.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,11 @@
2222
#ifndef ZEND_OPTIMIZER_H
2323
#define ZEND_OPTIMIZER_H
2424

25-
#include "zend.h"
26-
#include "zend_compile.h"
25+
#include "zend_compile.h" // for zend_op_array
26+
#include "zend_hash.h"
27+
#include "zend_portability.h" // for BEGIN_EXTERN_C
28+
29+
typedef struct _zend_string zend_string;
2730

2831
#define ZEND_OPTIMIZER_PASS_1 (1<<0) /* Simple local optimizations */
2932
#define ZEND_OPTIMIZER_PASS_2 (1<<1) /* */

Zend/Optimizer/zend_ssa.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,13 @@
1717
+----------------------------------------------------------------------+
1818
*/
1919

20-
#include "zend_compile.h"
21-
#include "zend_dfg.h"
2220
#include "zend_ssa.h"
21+
#include "zend_arena.h"
22+
#include "zend_optimizer_internal.h"
23+
#include "zend_dfg.h"
2324
#include "zend_dump.h"
24-
#include "zend_inference.h"
25-
#include "Optimizer/zend_optimizer_internal.h"
25+
#include "zend_inference.h" // for zend_sub_will_overflow()
26+
#include "zend_type_info.h" // for MAY_BE_REF
2627

2728
static bool dominates(const zend_basic_block *blocks, int a, int b) {
2829
while (blocks[b].level > blocks[a].level) {

Zend/Optimizer/zend_ssa.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,14 @@
1919
#ifndef ZEND_SSA_H
2020
#define ZEND_SSA_H
2121

22-
#include "zend_optimizer.h"
2322
#include "zend_cfg.h"
23+
#include "zend_compile.h" // for struct _zend_op
24+
#include "zend_long.h"
25+
#include "zend_portability.h" // for BEGIN_EXTERN_C
26+
#include "zend_types.h" // for zend_result
27+
28+
typedef struct _zend_class_entry zend_class_entry;
29+
typedef struct _zend_script zend_script;
2430

2531
typedef struct _zend_ssa_range {
2632
zend_long min;

Zend/tests/fibers/gh10249.phpt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
--TEST--
2+
GH-10249 (Assertion `size >= page_size + 1 * page_size' failed.)
3+
--FILE--
4+
<?php
5+
6+
$callback = function () {};
7+
ini_set("fiber.stack_size", "");
8+
$fiber = new Fiber($callback);
9+
try {
10+
$fiber->start();
11+
} catch (Exception $e) {
12+
echo $e->getMessage() . "\n";
13+
}
14+
15+
?>
16+
--EXPECTF--
17+
Fiber stack size is too small, it needs to be at least %d bytes

Zend/tests/fibers/gh9735-001.phpt

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
--TEST--
2+
Bug GH-9735 001 (Fiber stack variables do not participate in cycle collector)
3+
--FILE--
4+
<?php
5+
6+
class C {
7+
public function __destruct() {
8+
echo __METHOD__, "\n";
9+
}
10+
}
11+
12+
$fiber = new Fiber(function () {
13+
$c = new C();
14+
15+
$fiber = Fiber::getCurrent();
16+
17+
Fiber::suspend();
18+
});
19+
20+
print "1\n";
21+
22+
$fiber->start();
23+
gc_collect_cycles();
24+
25+
print "2\n";
26+
27+
$fiber = null;
28+
gc_collect_cycles();
29+
30+
print "3\n";
31+
32+
?>
33+
--EXPECT--
34+
1
35+
2
36+
C::__destruct
37+
3

Zend/tests/fibers/gh9735-002.phpt

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
--TEST--
2+
Bug GH-9735 002 (Fiber stack variables do not participate in cycle collector)
3+
--FILE--
4+
<?php
5+
6+
class C {
7+
public function __destruct() {
8+
echo __METHOD__, "\n";
9+
}
10+
}
11+
12+
function f() {
13+
Fiber::suspend();
14+
}
15+
16+
$fiber = new Fiber(function () {
17+
$c = new C();
18+
19+
$fiber = Fiber::getCurrent();
20+
21+
f();
22+
});
23+
24+
print "1\n";
25+
26+
$fiber->start();
27+
gc_collect_cycles();
28+
29+
print "2\n";
30+
31+
$fiber = null;
32+
gc_collect_cycles();
33+
34+
print "3\n";
35+
36+
?>
37+
--EXPECT--
38+
1
39+
2
40+
C::__destruct
41+
3

0 commit comments

Comments
 (0)