Skip to content

Commit a6dc102

Browse files
committed
Merge remote-tracking branch 'origin/PHP-8.2' into tests_psalm_phpstan_phpseclib
2 parents 1d97fcf + 95c5c40 commit a6dc102

File tree

2,913 files changed

+154055
-75098
lines changed

Some content is hidden

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

2,913 files changed

+154055
-75098
lines changed

.circleci/config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ jobs:
177177
echo opcache.protect_memory=1 >> /etc/php.d/opcache.ini
178178
- run:
179179
name: Test
180+
no_output_timeout: 30m
180181
command: |
181182
sapi/cli/php run-tests.php \
182183
-d zend_extension=opcache.so \
@@ -185,6 +186,7 @@ jobs:
185186
-d opcache.jit=tracing \
186187
-P -q -x -j2 \
187188
-g FAIL,BORK,LEAK,XLEAK \
189+
--no-progress \
188190
--offline \
189191
--show-diff \
190192
--show-slow 1000 \

.cirrus.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ freebsd_task:
2525
tests_script:
2626
- export SKIP_IO_CAPTURE_TESTS=1
2727
- export CI_NO_IPV6=1
28-
- sapi/cli/php run-tests.php -P -q -j2 -g FAIL,XFAIL,BORK,WARN,LEAK,XLEAK,SKIP --offline --show-diff --show-slow 1000 --set-timeout 120 -d zend_extension=opcache.so
28+
- sapi/cli/php run-tests.php -P -q -j2 -g FAIL,BORK,LEAK,XLEAK --no-progress --offline --show-diff --show-slow 1000 --set-timeout 120 -d zend_extension=opcache.so

.gdbinit

Lines changed: 38 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -66,18 +66,18 @@ define dump_bt
6666
if $func
6767
if $ex->This->value.obj
6868
if $func->common.scope
69-
printf "%s->", $func->common.scope->name->val
69+
printf "%s->", (char*)$func->common.scope->name->val
7070
else
71-
printf "%s->", $ex->This->value.obj->ce.name->val
71+
printf "%s->", (char*)$ex->This->value.obj->ce.name->val
7272
end
7373
else
7474
if $func->common.scope
75-
printf "%s::", $func->common.scope->name->val
75+
printf "%s::", (char*)$func->common.scope->name->val
7676
end
7777
end
7878

7979
if $func->common.function_name
80-
printf "%s(", $func->common.function_name->val
80+
printf "%s(", (char*)$func->common.function_name->val
8181
else
8282
printf "(main"
8383
end
@@ -109,7 +109,7 @@ define dump_bt
109109
printf "%f", $zvalue->value.dval
110110
end
111111
if $type == 6
112-
____print_str $zvalue->value.str->val $zvalue->value.str->len
112+
____print_str (char*)$zvalue->value.str->val $zvalue->value.str->len
113113
end
114114
if $type == 7
115115
printf "array(%d)[%p]", $zvalue->value.arr->nNumOfElements, $zvalue
@@ -135,7 +135,7 @@ define dump_bt
135135
end
136136
if $func != 0
137137
if $func->type == 2
138-
printf "%s:%d ", $func->op_array.filename->val, $ex->opline->lineno
138+
printf "%s:%d ", (char*)$func->op_array.filename->val, $ex->opline->lineno
139139
else
140140
printf "[internal function]"
141141
end
@@ -186,7 +186,7 @@ define ____printzv_contents
186186
printf "double: %f", $zvalue->value.dval
187187
end
188188
if $type == 6
189-
printf "string: %s", $zvalue->value.str->val
189+
printf "string: %s", (char*)$zvalue->value.str->val
190190
end
191191
if $type == 7
192192
printf "array: "
@@ -208,7 +208,7 @@ define ____printzv_contents
208208
set $handle = $zvalue->value.obj.handle
209209
set $handlers = $zvalue->value.obj.handlers
210210
set $zobj = $zvalue->value.obj
211-
set $cname = $zobj->ce->name->val
211+
set $cname = (char*)$zobj->ce->name->val
212212
printf "(%s) #%d", $cname, $handle
213213
if ! $arg1
214214
if $handlers->get_properties == &zend_std_get_properties
@@ -233,7 +233,7 @@ define ____printzv_contents
233233
set $name = $p->key
234234
set $prop = (zend_property_info*)$p->val.value.ptr
235235
set $val = (zval*)((char*)$zobj + $prop->offset)
236-
printf "%s => ", $name->val
236+
printf "%s => ", (char*)$name->val
237237
printzv $val
238238
set $k = $k + 1
239239
end
@@ -318,7 +318,8 @@ define ____print_ht
318318
set $n = $n - 1
319319
end
320320

321-
if $ht->u.v.flags & 4
321+
set $packed = $ht->u.v.flags & 4
322+
if $packed
322323
printf "Packed"
323324
else
324325
printf "Hash"
@@ -329,36 +330,45 @@ define ____print_ht
329330
set $i = 0
330331
set $ind = $ind + 1
331332
while $i < $num
332-
set $p = (Bucket*)($ht->arData + $i)
333+
if $packed
334+
set $val = (zval*)($ht->arPacked + $i)
335+
set $key = (zend_string*)0
336+
set $h = $i
337+
else
338+
set $bucket = (Bucket*)($ht->arData + $i)
339+
set $val = &$bucket->val
340+
set $key = $bucket->key
341+
set $h = $bucket->h
342+
end
333343
set $n = $ind
334-
if $p->val.u1.v.type > 0
344+
if $val->u1.v.type > 0
335345
while $n > 0
336346
printf " "
337347
set $n = $n - 1
338348
end
339349
printf "[%d] ", $i
340-
if $p->key
341-
____print_str $p->key->val $p->key->len
350+
if $key
351+
____print_str (char*)$key->val $key->len
342352
printf " => "
343353
else
344-
printf "%d => ", $p->h
354+
printf "%d => ", $h
345355
end
346356
if $arg1 == 0
347-
printf "%p\n", (zval *)&$p->val
357+
printf "%p\n", $val
348358
end
349359
if $arg1 == 1
350-
set $zval = (zval *)&$p->val
360+
set $zval = $val
351361
____printzv $zval 1
352362
end
353363
if $arg1 == 2
354-
printf "%s\n", (char*)$p->val.value.ptr
364+
printf "%s\n", (char*)$val->value.ptr
355365
end
356366
if $arg1 == 3
357-
set $func = (zend_function*)$p->val.value.ptr
358-
printf "\"%s\"\n", $func->common.function_name->val
367+
set $func = (zend_function*)$val->value.ptr
368+
printf "\"%s\"\n", (char*)$func->common.function_name->val
359369
end
360370
if $arg1 == 4
361-
set $const = (zend_constant *)$p->val.value.ptr
371+
set $const = (zend_constant *)$val->value.ptr
362372
____printzv $const 1
363373
end
364374
end
@@ -413,15 +423,15 @@ define ____print_inh_class
413423
printf "final "
414424
end
415425
end
416-
printf "class %s", $ce->name->val
426+
printf "class %s", (char*)$ce->name->val
417427
if $ce->parent != 0
418-
printf " extends %s", $ce->parent->name->val
428+
printf " extends %s", (char*)$ce->parent->name->val
419429
end
420430
if $ce->num_interfaces != 0
421431
printf " implements"
422432
set $tmp = 0
423433
while $tmp < $ce->num_interfaces
424-
printf " %s", $ce->interfaces[$tmp]->name->val
434+
printf " %s", (char*)$ce->interfaces[$tmp]->name->val
425435
set $tmp = $tmp + 1
426436
if $tmp < $ce->num_interfaces
427437
printf ","
@@ -433,10 +443,10 @@ end
433443

434444
define ____print_inh_iface
435445
set $ce = $arg0
436-
printf "interface %s", $ce->name->val
446+
printf "interface %s", (char*)$ce->name->val
437447
if $ce->num_interfaces != 0
438448
set $ce = $ce->interfaces[0]
439-
printf " extends %s", $ce->name->val
449+
printf " extends %s", (char*)$ce->name->val
440450
else
441451
set $ce = 0
442452
end
@@ -476,7 +486,7 @@ define print_pi
476486
set $ptr_to_val = (zval*)((char*)$pi->ce->default_properties_table + $pi->offset - $initial_offset)
477487
printf "[%p] {\n", $pi
478488
printf " offset = %p\n", $pi->offset
479-
printf " ce = [%p] %s\n", $pi->ce, $pi->ce->name->val
489+
printf " ce = [%p] %s\n", $pi->ce, (char*)$pi->ce->name->val
480490
printf " flags = 0x%x (", $pi->flags
481491
if $pi->flags & 0x100
482492
printf "ZEND_ACC_PUBLIC"
@@ -598,7 +608,7 @@ define print_zstr
598608
set $maxlen = $zstr->len
599609
end
600610
printf "string(%d) ", $zstr->len
601-
____print_str $zstr->val $zstr->len $maxlen
611+
____print_str (char*)$zstr->val $zstr->len $maxlen
602612
printf "\n"
603613
end
604614

.gitattributes

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,16 @@
1313
/UPGRADING merge=NEWS
1414
/UPGRADING.INTERNALS merge=NEWS
1515

16-
# Enable commit diffs for binary PHP test files. Some PHP test files include
17-
# special characters, such as ASCII control characters. Git recognizes these as
18-
# binary and wouldn't generate diffs.
19-
*.phpt diff
16+
# Configure proper diff drivers to improve the context lines in the output
17+
# of git diff and to improve token splitting for --word-diff.
18+
*.phpt diff=php
19+
*.php diff=php
20+
*.[ch] diff=cpp
21+
22+
# Collapse generated files within a pull request.
23+
**/*_arginfo.h linguist-generated
24+
/Zend/zend_vm_execute.h linguist-generated
25+
/Zend/zend_vm_opcodes.{h,c} linguist-generated
26+
27+
# The OSS fuzz files are bunary
28+
/ext/date/tests/ossfuzz*.txt binary
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Bug report
2+
description: Create a bug report
3+
labels: ["Bug", "Status: Needs Triage"]
4+
body:
5+
- type: textarea
6+
attributes:
7+
label: Description
8+
description: "Please provide a minimal way to reproduce the problem and describe what the expected vs actual behavior is. Provide a [3v4l.org](https://3v4l.org/) link if possible."
9+
value: |
10+
The following code:
11+
12+
```php
13+
<?php
14+
```
15+
16+
Resulted in this output:
17+
```
18+
```
19+
20+
But I expected this output instead:
21+
```
22+
```
23+
validations:
24+
required: true
25+
- type: input
26+
attributes:
27+
label: PHP Version
28+
description: "The used PHP version. Make sure it is [supported](https://www.php.net/supported-versions.php)."
29+
placeholder: "PHP 8.0.12"
30+
validations:
31+
required: true
32+
- type: input
33+
attributes:
34+
label: Operating System
35+
description: "The used operating system, if relevant."
36+
placeholder: "Ubuntu 20.04"

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Documentation issue
4+
url: https://github.com/php/doc-en/issues
5+
about: Please report documentation issues on the doc-en repository.
6+
- name: Security issue
7+
url: https://bugs.php.net/report.php?security_bug
8+
about: Please report security issues in this private bug tracker.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: Feature request
2+
description: Create a feature request
3+
labels: ["Feature", "Status: Needs Triage"]
4+
body:
5+
- type: textarea
6+
attributes:
7+
label: Description
8+
description: "Please describe the requested feature and why it should be included in PHP."
9+
validations:
10+
required: true

.github/actions/setup-caddy/action.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ runs:
33
using: composite
44
steps:
55
- shell: bash
6+
env:
7+
GH_TOKEN: ${{ github.token }}
68
run: |
79
set -x
8-
sudo curl 'https://caddyserver.com/api/download?os=linux&arch=amd64' -o /usr/bin/caddy
10+
gh release -R caddyserver/caddy download --pattern 'caddy_*_linux_amd64.tar.gz' -O - | sudo tar -xz -C /usr/bin caddy
911
sudo chmod +x /usr/bin/caddy
1012
sudo caddy start --config ext/curl/tests/Caddyfile

.github/actions/test-libmysqlclient/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ runs:
1616
export PDO_MYSQL_TEST_PASS=root
1717
export REPORT_EXIT_STATUS=no
1818
sapi/cli/php run-tests.php -P -q \
19-
-g FAIL,XFAIL,BORK,WARN,LEAK,XLEAK,SKIP \
20-
--offline --show-diff --show-slow 1000 --set-timeout 120 \
19+
-g FAIL,BORK,LEAK,XLEAK \
20+
--no-progress --offline --show-diff --show-slow 1000 --set-timeout 120 \
2121
ext/pdo_mysql

.github/actions/test-linux/action.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
name: Test
22
inputs:
3+
testArtifacts:
4+
default: null
5+
required: false
36
runTestsParameters:
47
default: ''
58
required: false
69
jitType:
710
default: 'disable'
811
required: false
12+
idleCpu:
13+
default: 'false'
14+
required: false
915
runs:
1016
using: composite
1117
steps:
@@ -29,12 +35,20 @@ runs:
2935
export PDO_OCI_TEST_PASS="pass"
3036
export PDO_OCI_TEST_DSN="oci:dbname=localhost/XEPDB1;charset=AL32UTF8"
3137
export SKIP_IO_CAPTURE_TESTS=1
38+
export TEST_PHP_JUNIT=junit.out.xml
3239
sapi/cli/php run-tests.php -P -q ${{ inputs.runTestsParameters }} \
3340
-d opcache.jit=${{ inputs.jitType }} \
3441
-d opcache.jit_buffer_size=16M \
35-
-j$(/usr/bin/nproc) \
36-
-g FAIL,XFAIL,BORK,WARN,LEAK,XLEAK,SKIP \
42+
${{ inputs.idleCpu == 'true' && '-j$(($(/usr/bin/nproc) - 1))' || '-j$(/usr/bin/nproc)' }} \
43+
-g FAIL,BORK,LEAK,XLEAK \
44+
--no-progress \
3745
--offline \
3846
--show-diff \
3947
--show-slow 1000 \
4048
--set-timeout 120
49+
- uses: actions/upload-artifact@v4
50+
if: always() && inputs.testArtifacts != null
51+
with:
52+
name: ${{ github.job }}_${{ inputs.testArtifacts }}
53+
path: ${{ github.workspace }}/junit.out.xml
54+
retention-days: 5

0 commit comments

Comments
 (0)