Skip to content

Commit b510ebd

Browse files
authored
Merge pull request #16 from php/master
sync
2 parents adf3789 + 414f7fc commit b510ebd

File tree

190 files changed

+4844
-2490
lines changed

Some content is hidden

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

190 files changed

+4844
-2490
lines changed

.github/nightly_matrix.php

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<?php
2+
3+
const BRANCHES = ['master', 'PHP-8.1', 'PHP-8.0'];
4+
5+
function get_branch_commit_cache_file_path(): string {
6+
return dirname(__DIR__) . '/branch-commit-cache.json';
7+
}
8+
9+
function get_branch_matrix(array $branches) {
10+
$result = array_map(function ($branch) {
11+
$branch_key = strtoupper(str_replace('.', '', $branch));
12+
return [
13+
'name' => $branch_key,
14+
'ref' => $branch,
15+
];
16+
}, $branches);
17+
18+
return $result;
19+
}
20+
21+
function get_branches() {
22+
$branch_commit_cache_file = get_branch_commit_cache_file_path();
23+
$branch_commit_map = [];
24+
if (file_exists($branch_commit_cache_file)) {
25+
$branch_commit_map = json_decode(file_get_contents($branch_commit_cache_file), JSON_THROW_ON_ERROR);
26+
}
27+
28+
$changed_branches = [];
29+
foreach (BRANCHES as $branch) {
30+
$previous_commit_hash = $branch_commit_map[$branch] ?? null;
31+
$current_commit_hash = trim(shell_exec('git rev-parse origin/' . $branch));
32+
33+
if ($previous_commit_hash !== $current_commit_hash) {
34+
$changed_branches[] = $branch;
35+
}
36+
37+
$branch_commit_map[$branch] = $current_commit_hash;
38+
}
39+
40+
file_put_contents($branch_commit_cache_file, json_encode($branch_commit_map));
41+
42+
return get_branch_matrix($changed_branches);
43+
}
44+
45+
function get_asan_matrix(array $branches) {
46+
$jobs = [];
47+
foreach ($branches as $branch) {
48+
$jobs[] = [
49+
'name' => '_ASAN_UBSAN',
50+
'branch' => $branch,
51+
'debug' => true,
52+
'zts' => true,
53+
'configuration_parameters' => "CFLAGS='-fsanitize=undefined,address -DZEND_TRACK_ARENA_ALLOC' LDFLAGS='-fsanitize=undefined,address'",
54+
'run_tests_parameters' => '--asan',
55+
];
56+
}
57+
return $jobs;
58+
}
59+
60+
$trigger = $argv[1] ?? 'schedule';
61+
$attempt = (int) ($argv[2] ?? 1);
62+
$discard_cache = ($trigger === 'schedule' && $attempt !== 1) || $trigger === 'workflow_dispatch';
63+
if ($discard_cache) {
64+
@unlink(get_branch_commit_cache_file_path());
65+
}
66+
67+
$branches = get_branches();
68+
$asan_matrix = get_asan_matrix($branches);
69+
70+
echo '::set-output name=branches::' . json_encode($branches, JSON_UNESCAPED_SLASHES) . "\n";
71+
echo '::set-output name=asan-matrix::' . json_encode($asan_matrix, JSON_UNESCAPED_SLASHES) . "\n";

.github/workflows/nightly.yml

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
name: Nightly
2+
on:
3+
schedule:
4+
- cron: "0 1 * * *"
5+
workflow_dispatch: ~
6+
jobs:
7+
GENERATE_MATRIX:
8+
name: Generate Matrix
9+
runs-on: ubuntu-latest
10+
outputs:
11+
branches: ${{ steps.set-matrix.outputs.branches }}
12+
asan-matrix: ${{ steps.set-matrix.outputs.asan-matrix }}
13+
steps:
14+
- uses: actions/checkout@v2
15+
with:
16+
# Set fetch-depth to 0 to clone the full repository
17+
# including all branches. This is required to find
18+
# the correct commit hashes.
19+
fetch-depth: 0
20+
- name: Grab the commit mapping
21+
uses: actions/cache@v3
22+
with:
23+
path: branch-commit-cache.json
24+
# The cache key needs to change every time for the
25+
# cache to be updated after this job finishes.
26+
key: nightly-${{ github.run_id }}-${{ github.run_attempt }}
27+
restore-keys: |
28+
nightly-
29+
- name: Generate Matrix
30+
id: set-matrix
31+
run: php .github/nightly_matrix.php "${{ github.event_name }}" "${{ github.run_attempt }}"
32+
LINUX_X64:
33+
needs: GENERATE_MATRIX
34+
if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }}
35+
strategy:
36+
fail-fast: false
37+
matrix:
38+
branch: ${{ fromJson(needs.GENERATE_MATRIX.outputs.branches) }}
39+
debug: [true, false]
40+
zts: [true, false]
41+
include: ${{ fromJson(needs.GENERATE_MATRIX.outputs.asan-matrix) }}
42+
name: "${{ matrix.branch.name }}_LINUX_X64${{ matrix.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}"
43+
runs-on: ubuntu-20.04
44+
steps:
45+
- name: git checkout
46+
uses: actions/checkout@v2
47+
with:
48+
ref: ${{ matrix.branch.ref }}
49+
- name: Create mssql container
50+
uses: ./.github/actions/mssql
51+
- name: apt
52+
uses: ./.github/actions/apt-x64
53+
- name: ./configure
54+
uses: ./.github/actions/configure-x64
55+
with:
56+
configurationParameters: >-
57+
${{ matrix.configuration_parameters }}
58+
--${{ matrix.debug && 'enable' || 'disable' }}-debug
59+
--${{ matrix.zts && 'enable' || 'disable' }}-zts
60+
- name: make
61+
run: make -j$(/usr/bin/nproc) >/dev/null
62+
- name: make install
63+
uses: ./.github/actions/install-linux
64+
- name: Setup
65+
uses: ./.github/actions/setup-x64
66+
- name: Test
67+
uses: ./.github/actions/test-linux
68+
with:
69+
runTestsParameters: >-
70+
${{ matrix.run_tests_parameters }}
71+
- name: Test Tracing JIT
72+
uses: ./.github/actions/test-linux
73+
with:
74+
runTestsParameters: >-
75+
${{ matrix.run_tests_parameters }}
76+
-d zend_extension=opcache.so
77+
-d opcache.jit_buffer_size=16M
78+
- name: Test OpCache
79+
uses: ./.github/actions/test-linux
80+
with:
81+
runTestsParameters: >-
82+
${{ matrix.run_tests_parameters }}
83+
-d zend_extension=opcache.so
84+
- name: Test Function JIT
85+
uses: ./.github/actions/test-linux
86+
with:
87+
runTestsParameters: >-
88+
${{ matrix.run_tests_parameters }}
89+
-d zend_extension=opcache.so
90+
-d opcache.jit_buffer_size=16M
91+
-d opcache.jit=1205
92+
MACOS:
93+
needs: GENERATE_MATRIX
94+
if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }}
95+
strategy:
96+
fail-fast: false
97+
matrix:
98+
branch: ${{ fromJson(needs.GENERATE_MATRIX.outputs.branches) }}
99+
debug: [true, false]
100+
zts: [true, false]
101+
name: "${{ matrix.branch.name }}_MACOS_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}"
102+
runs-on: macos-10.15
103+
steps:
104+
- name: git checkout
105+
uses: actions/checkout@v2
106+
with:
107+
ref: ${{ matrix.branch.ref }}
108+
- name: brew
109+
uses: ./.github/actions/brew
110+
- name: ./configure
111+
uses: ./.github/actions/configure-macos
112+
with:
113+
configurationParameters: >-
114+
--${{ matrix.debug && 'enable' || 'disable' }}-debug
115+
--${{ matrix.zts && 'enable' || 'disable' }}-zts
116+
- name: make
117+
run: |-
118+
export PATH="/usr/local/opt/bison/bin:$PATH"
119+
make -j$(sysctl -n hw.logicalcpu) >/dev/null
120+
- name: make install
121+
run: sudo make install
122+
- name: Test
123+
uses: ./.github/actions/test-macos
124+
- name: Test Tracing JIT
125+
uses: ./.github/actions/test-macos
126+
with:
127+
runTestsParameters: >-
128+
-d zend_extension=opcache.so
129+
-d opcache.protect_memory=1
130+
-d opcache.jit_buffer_size=16M
131+
- name: Test OpCache
132+
uses: ./.github/actions/test-macos
133+
with:
134+
runTestsParameters: >-
135+
-d zend_extension=opcache.so
136+
-d opcache.protect_memory=1
137+
- name: Test Function JIT
138+
uses: ./.github/actions/test-macos
139+
with:
140+
runTestsParameters: >-
141+
-d zend_extension=opcache.so
142+
-d opcache.protect_memory=1
143+
-d opcache.jit_buffer_size=16M
144+
-d opcache.jit=1205

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,11 @@ tmp-php.ini
277277
/Zend/zend_dtrace_gen.h
278278
/Zend/zend_dtrace_gen.h.bak
279279

280+
# ------------------------------------------------------------------------------
281+
# GitHub actions cache
282+
# ------------------------------------------------------------------------------
283+
/branch-commit-cache.json
284+
280285
# ------------------------------------------------------------------------------
281286
# Special cases to invert previous ignore patterns
282287
# ------------------------------------------------------------------------------

NEWS

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ PHP NEWS
1010
. Fixed bug GH-7771 (Fix filename/lineno of constant expressions). (ilutov)
1111
. Fixed bug GH-7792 (Improve class type in error messages). (ilutov)
1212

13+
- FPM:
14+
. Emit error for invalid port setting. (David Carlier)
15+
. Added extra check for FPM proc dumpable on SELinux based systems.
16+
(David Carlier)
17+
1318
- Intl:
1419
. Update all grandfathered language tags with preferred values
1520
. Fixed GH-7939 (Cannot unserialize IntlTimeZone objects). (cmb)
@@ -23,6 +28,9 @@ PHP NEWS
2328
. Fixed bug #80909 (crash with persistent connections in PDO_ODBC). (Calvin
2429
Buckley)
2530

31+
- Sodium:
32+
. Added sodium_crypto_stream_xchacha20_xor_ic(). (Scott)
33+
2634
- Standard:
2735
. net_get_interfaces() also reports wireless network interfaces on Windows.
2836
(Yurun)

UPGRADING

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,24 @@ PHP 8.2 UPGRADE NOTES
2727
array_change_key_case and sorting with SORT_FLAG_CASE use ASCII case
2828
conversion.
2929

30+
- SPL:
31+
. The following methods now enforce their signature:
32+
* SplFileInfo::_bad_state_ex()
33+
* SplFileObject::getCsvControl()
34+
* SplFileObject::fflush()
35+
* SplFileObject::ftell()
36+
* SplFileObject::fgetc()
37+
* SplFileObject::fpassthru()
38+
3039
========================================
3140
2. New Features
3241
========================================
3342

43+
- Core:
44+
. Added the #[\SensitiveParameter] attribute to redact sensitive data in
45+
backtraces.
46+
RFC: https://wiki.php.net/rfc/redact_parameters_in_back_traces
47+
3448
- Curl:
3549
. Added CURLINFO_EFFECTIVE_METHOD option and returning the effective
3650
HTTP method in curl_getinfo() return value.
@@ -114,6 +128,9 @@ PHP 8.2 UPGRADE NOTES
114128
6. New Functions
115129
========================================
116130

131+
- Sodium:
132+
. sodium_crypto_stream_xchacha20_xor_ic()
133+
117134
- Standard:
118135
. The peak memory usage can now be reset to the current usage thanks to
119136
memory_reset_peak_usage().

Zend/Optimizer/zend_func_infos.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ static const func_info_t func_infos[] = {
508508
F1("long2ip", MAY_BE_STRING|MAY_BE_FALSE),
509509
F1("getenv", MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_STRING|MAY_BE_FALSE),
510510
F1("getopt", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_STRING|MAY_BE_ARRAY_OF_ARRAY|MAY_BE_ARRAY_OF_FALSE|MAY_BE_FALSE),
511-
#if HAVE_NANOSLEEP
511+
#if defined(HAVE_NANOSLEEP)
512512
F1("time_nanosleep", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_LONG|MAY_BE_BOOL),
513513
#endif
514514
F1("get_current_user", MAY_BE_STRING),
@@ -522,10 +522,10 @@ static const func_info_t func_infos[] = {
522522
F1("set_include_path", MAY_BE_STRING|MAY_BE_FALSE),
523523
F1("get_include_path", MAY_BE_STRING|MAY_BE_FALSE),
524524
F1("print_r", MAY_BE_STRING|MAY_BE_BOOL),
525-
#if HAVE_GETSERVBYPORT
525+
#if defined(HAVE_GETSERVBYPORT)
526526
F1("getservbyport", MAY_BE_STRING|MAY_BE_FALSE),
527527
#endif
528-
#if HAVE_GETPROTOBYNUMBER
528+
#if defined(HAVE_GETPROTOBYNUMBER)
529529
F1("getprotobynumber", MAY_BE_STRING|MAY_BE_FALSE),
530530
#endif
531531
F1("parse_ini_file", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_FALSE|MAY_BE_ARRAY_OF_TRUE|MAY_BE_ARRAY_OF_LONG|MAY_BE_ARRAY_OF_DOUBLE|MAY_BE_ARRAY_OF_STRING|MAY_BE_ARRAY_OF_ARRAY|MAY_BE_ARRAY_OF_NULL|MAY_BE_FALSE),
@@ -538,7 +538,7 @@ static const func_info_t func_infos[] = {
538538
#endif
539539
F1("get_browser", MAY_BE_OBJECT|MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_ANY|MAY_BE_FALSE),
540540
F1("crypt", MAY_BE_STRING),
541-
#if HAVE_STRPTIME
541+
#if defined(HAVE_STRPTIME)
542542
F1("strptime", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_LONG|MAY_BE_ARRAY_OF_STRING|MAY_BE_FALSE),
543543
#endif
544544
#if defined(HAVE_GETHOSTNAME)
@@ -547,7 +547,7 @@ static const func_info_t func_infos[] = {
547547
F1("gethostbyaddr", MAY_BE_STRING|MAY_BE_FALSE),
548548
F1("gethostbyname", MAY_BE_STRING),
549549
F1("gethostbynamel", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_STRING|MAY_BE_FALSE),
550-
#if defined(PHP_WIN32) || HAVE_DNS_SEARCH_FUNC
550+
#if defined(PHP_WIN32) || defined(HAVE_DNS_SEARCH_FUNC)
551551
F1("dns_get_record", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_ARRAY|MAY_BE_FALSE),
552552
#endif
553553
F1("md5", MAY_BE_STRING),
@@ -573,7 +573,7 @@ static const func_info_t func_infos[] = {
573573
F1("get_html_translation_table", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_STRING|MAY_BE_ARRAY_OF_STRING),
574574
F1("bin2hex", MAY_BE_STRING),
575575
F1("hex2bin", MAY_BE_STRING|MAY_BE_FALSE),
576-
#if HAVE_NL_LANGINFO
576+
#if defined(HAVE_NL_LANGINFO)
577577
F1("nl_langinfo", MAY_BE_STRING|MAY_BE_FALSE),
578578
#endif
579579
F1("wordwrap", MAY_BE_STRING),
@@ -701,7 +701,7 @@ static const func_info_t func_infos[] = {
701701
F1("stream_socket_server", MAY_BE_RESOURCE|MAY_BE_FALSE),
702702
F1("stream_socket_accept", MAY_BE_RESOURCE|MAY_BE_FALSE),
703703
F1("stream_socket_recvfrom", MAY_BE_STRING|MAY_BE_FALSE),
704-
#if HAVE_SOCKETPAIR
704+
#if defined(HAVE_SOCKETPAIR)
705705
F1("stream_socket_pair", MAY_BE_ARRAY|MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_OF_RESOURCE|MAY_BE_FALSE),
706706
#endif
707707
F1("stream_get_contents", MAY_BE_STRING|MAY_BE_FALSE),

0 commit comments

Comments
 (0)