Skip to content
forked from php/php-src

Commit 2032ee3

Browse files
authored
Merge pull request #10 from php/master
sysnc
2 parents 725f0ef + 80d2ade commit 2032ee3

File tree

10,783 files changed

+561734
-233784
lines changed

Some content is hidden

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

10,783 files changed

+561734
-233784
lines changed

.cirrus.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
env:
2+
CIRRUS_CLONE_DEPTH: 1
3+
ARCH: amd64
4+
5+
freebsd_instance:
6+
image_family: freebsd-13-0
7+
8+
task:
9+
name: FREEBSD_DEBUG_NTS
10+
install_script:
11+
#- sed -i -e 's/quarterly/latest/g' /etc/pkg/FreeBSD.conf
12+
#- pkg upgrade -y
13+
- kldload accf_http
14+
- pkg install -y autoconf bison gmake re2c icu libiconv png freetype2 enchant2 bzip2 krb5 t1lib gmp tidyp libsodium libzip libxml2 libxslt openssl oniguruma pkgconf webp libavif
15+
script:
16+
- ./buildconf -f
17+
- ./configure --prefix=/usr/local --enable-debug --enable-option-checking=fatal --enable-fpm --with-pdo-sqlite --without-pear --with-bz2 --with-avif --with-jpeg --with-webp --with-freetype --enable-gd --enable-exif --with-zip --with-zlib --enable-soap --enable-xmlreader --with-xsl --with-libxml --enable-shmop --enable-pcntl --enable-mbstring --with-curl --enable-sockets --with-openssl --with-iconv=/usr/local --enable-bcmath --enable-calendar --enable-ftp --with-kerberos --with-ffi --enable-zend-test --enable-intl --with-mhash --with-sodium --enable-werror --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d
18+
- gmake -j2
19+
- mkdir /etc/php.d
20+
- gmake install
21+
- echo opcache.enable_cli=1 > /etc/php.d/opcache.ini
22+
- echo opcache.protect_memory=1 >> /etc/php.d/opcache.ini
23+
# Specify opcache.preload_user as we're running as root.
24+
- echo opcache.preload_user=root >> /etc/php.d/opcache.ini
25+
tests_script:
26+
- export SKIP_IO_CAPTURE_TESTS=1
27+
- 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

.gdbinit

+3-4
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ end
1111

1212
define ____executor_globals
1313
if basic_functions_module.zts
14-
if !$tsrm_ls
15-
set $tsrm_ls = ts_resource_ex(0, 0)
16-
end
14+
set $tsrm_ls = _tsrm_ls_cache
1715
set $eg = ((zend_executor_globals*) (*((void ***) $tsrm_ls))[executor_globals_id-1])
1816
set $cg = ((zend_compiler_globals*) (*((void ***) $tsrm_ls))[compiler_globals_id-1])
1917
set $eg_ptr = $eg
@@ -340,7 +338,8 @@ define ____print_ht
340338
end
341339
printf "[%d] ", $i
342340
if $p->key
343-
printf "%s => ", $p->key->val
341+
____print_str $p->key->val $p->key->len
342+
printf " => "
344343
else
345344
printf "%d => ", $p->h
346345
end

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@
4141
# Standard object files generated during build process
4242
*.o
4343

44+
# Dependency files generated during build process
45+
*.dep
46+
4447
# Cache directories created by Autoconf tools
4548
autom4te.cache/
4649

.travis.yml

+5-13
Original file line numberDiff line numberDiff line change
@@ -68,18 +68,10 @@ env:
6868

6969
jobs:
7070
include:
71-
- env: ENABLE_ZTS=0 ENABLE_DEBUG=0
72-
arch: amd64
73-
if: type = cron
74-
- env: ENABLE_ZTS=1 ENABLE_DEBUG=1
75-
arch: amd64
76-
if: type = cron
77-
- env: ENABLE_ZTS=1 ENABLE_DEBUG=1 SKIP_IO_CAPTURE_TESTS=1 ARM64=1
71+
- env: ENABLE_ZTS=1 ENABLE_DEBUG=1 ARM64=1
7872
arch: arm64
79-
if: type = cron
80-
- env: ENABLE_ZTS=1 ENABLE_DEBUG=1 SKIP_IO_CAPTURE_TESTS=1 S390X=1
73+
- env: ENABLE_ZTS=1 ENABLE_DEBUG=1 S390X=1
8174
arch: s390x
82-
if: type = cron
8375

8476
before_script:
8577
- ccache --version
@@ -95,9 +87,9 @@ before_script:
9587

9688
# Run PHPs run-tests.php
9789
script:
98-
# ARM64 CI reports nproc=32, which is excessive.
99-
- if [ -z "$ARM64" ]; then export JOBS=$(nproc); else export JOBS=16; fi
100-
- ./sapi/cli/php run-tests.php -P -d extension=`pwd`/modules/zend_test.so $(if [ $ENABLE_DEBUG == 0 ]; then echo "-d opcache.enable_cli=1 -d opcache.protect_memory=1 -d opcache.jit_buffer_size=16M -d zend_extension=`pwd`/modules/opcache.so"; fi) -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" --offline --show-diff --show-slow 1000 --set-timeout 120 -j$JOBS
90+
- ./travis/test.sh -d opcache.jit_buffer_size=16M -d opcache.jit=tracing
91+
- if [[ "$ARM64" == 1 ]]; then ./travis/test.sh -d opcache.jit_buffer_size=16M -d opcache.jit=function; fi
92+
- if [[ "$ARM64" == 1 ]]; then ./travis/test.sh -d opcache.jit_buffer_size=16M -d opcache.jit=tracing --repeat 2; fi
10193
- sapi/cli/php -d extension_dir=`pwd`/modules -r 'dl("zend_test");'
10294

10395
after_success:

CODING_STANDARDS.md

+17-36
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,39 @@
11
# PHP coding standards
22

3-
This file lists several standards that any programmer adding or changing code in
4-
PHP should follow. Since this file was added at a very late stage of the
5-
development of PHP v3.0, the code base does not fully follow it, but new
6-
features are going in that general direction. Many sections have been recoded to
7-
use these rules.
3+
This file lists standards that any programmer adding or changing code in
4+
PHP should follow. The code base does not yet fully follow it, but new
5+
features are going in that general direction. Many sections have been
6+
rewritten to comply with these rules.
87

98
## Code implementation
109

1110
1. Document your code in source files and the manual. (tm)
1211

1312
2. Functions that are given pointers to resources should not free them.
1413

15-
For instance, `function int mail(char *to, char *from)` should NOT free to
16-
and/or from.
14+
For instance, `function int mail(char *to, char *from)` should NOT free `to`
15+
and/or `from`.
1716

1817
Exceptions:
1918

2019
* The function's designated behavior is freeing that resource. E.g.
2120
`efree()`
2221

2322
* The function is given a boolean argument, that controls whether or not the
24-
function may free its arguments (if true - the function must free its
25-
arguments, if false - it must not)
23+
function may free its arguments (if true, the function must free its
24+
arguments; if false, it must not)
2625

2726
* Low-level parser routines, that are tightly integrated with the token
2827
cache and the bison code for minimum memory copying overhead.
2928

3029
3. Functions that are tightly integrated with other functions within the same
31-
module, and rely on each other non-trivial behavior, should be documented as
30+
module, and rely on each other's non-trivial behavior, should be documented as
3231
such and declared `static`. They should be avoided if possible.
3332

3433
4. Use definitions and macros whenever possible, so that constants have
35-
meaningful names and can be easily manipulated. The only exceptions to this
36-
rule are 0 and 1, when used as `false` and `true` (respectively). Any other
37-
use of a numeric constant to specify different behavior or actions should be
38-
done through a `#define`.
34+
meaningful names and can be easily manipulated. Any use of a numeric
35+
constant to specify different behavior or actions should be done through
36+
a `#define`.
3937

4038
5. When writing functions that deal with strings, be sure to remember that PHP
4139
holds the length property of each string, and that it shouldn't be
@@ -260,35 +258,18 @@ use these rules.
260258
```
261259

262260
4. When indenting, use the tab character. A tab is expected to represent four
263-
spaces. It is important to maintain consistency in indenture so that
261+
spaces. It is important to maintain consistency in indentation so that
264262
definitions, comments, and control structures line up correctly.
265263

266264
5. Preprocessor statements (`#if` and such) MUST start at column one. To indent
267265
preprocessor directives you should put the `#` at the beginning of a line,
268-
followed by any number of whitespace.
266+
followed by any number of spaces.
269267

270268
## Testing
271269

272-
1. Extensions should be well tested using `*.phpt` tests. Read about that at
270+
1. Extensions should be well tested using `*.phpt` tests. Read more at
273271
[qa.php.net](https://qa.php.net/write-test.php) documentation.
274272

275-
## Folding hooks
276-
277-
Use `{{{` symbols for the folding mode in Emacs and vim (`set fdm=marker`).
278-
Folding is very useful when dealing with large files because you can scroll
279-
through the file quickly and just unfold the function you wish to work on.
280-
The `}}}` at the end of each function marks the end of the fold, and should
281-
be on a separate line.
282-
283-
```c
284-
/* {{{ Returns the absolute value of the number */
285-
PHP_FUNCTION(abs)
286-
{
287-
...
288-
}
289-
/* }}} */
290-
```
291-
292273
## New and experimental functions
293274

294275
To reduce the problems normally associated with the first public implementation
@@ -302,8 +283,8 @@ The file labelled `EXPERIMENTAL` should include the following information:
302283
* Any authoring information (known bugs, future directions of the module).
303284
* Ongoing status notes which may not be appropriate for Git comments.
304285

305-
In general new features should go to PECL or experimental branches until there
306-
are specific reasons for directly adding it to the core distribution.
286+
In general, new features should go to PECL or experimental branches until there
287+
are specific reasons for directly adding them to the core distribution.
307288

308289
## Aliases & legacy documentation
309290

CONTRIBUTING.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Anybody who programs in PHP can be a contributing member of the community that
44
develops and deploys it; the task of deploying PHP, documentation and associated
5-
websites is a never ending one. With every release, or release candidate comes a
5+
websites is a never-ending one. With every release or release candidate comes a
66
wave of work, which takes a lot of organization and co-ordination.
77

88
You don't need any special access to download, build, debug and begin submitting
@@ -85,7 +85,7 @@ for additional notes on the best way to approach submitting an RFC.
8585

8686
## Writing tests
8787

88-
We love getting new tests! PHP is a huge project and improving code coverage is
88+
We love getting new tests! PHP is a huge project and improving test coverage is
8989
a huge win for every PHP user.
9090

9191
[Our QA site includes a page detailing how to write test cases.](https://qa.php.net/write-test.php)
@@ -135,6 +135,7 @@ locations.
135135
├─ .git/ # Git configuration and source directory
136136
├─ TSRM/ # Thread Safe Resource Manager
137137
└─ Zend/ # Zend Engine
138+
├─ asm/ # Bundled from src/asm in https://github.com/boostorg/context
138139
├─ zend_vm_execute.h # Generated by `Zend/zend_vm_gen.php`
139140
├─ zend_vm_opcodes.c # Generated by `Zend/zend_vm_gen.php`
140141
├─ zend_vm_opcodes.h # Generated by `Zend/zend_vm_gen.php`
@@ -146,6 +147,7 @@ locations.
146147
├─ config.sub # https://git.savannah.gnu.org/cgit/config.git
147148
├─ libtool.m4 # https://git.savannah.gnu.org/cgit/libtool.git
148149
├─ ltmain.sh # https://git.savannah.gnu.org/cgit/libtool.git
150+
├─ pkg.m4 # https://gitlab.freedesktop.org/pkg-config/pkg-config
149151
├─ shtool # https://www.gnu.org/software/shtool/
150152
└─ ...
151153
├─ docs/ # PHP internals and repository documentation
@@ -253,30 +255,30 @@ included.
253255

254256
- Read [Coding standards](/CODING_STANDARDS.md) before you start working.
255257
- Update git source just before running your final `diff` and before testing.
256-
- Add in-line comments and/or have external documentation ready. Use only
258+
- Add inline comments and/or have external documentation ready. Use only
257259
`/* */` style comments, not `//`.
258260
- Create test scripts for use with `make test`.
259261
- Run `make test` to check your change doesn't break other features.
260262
- Rebuild PHP with `--enable-debug` which will show some kinds of memory errors
261263
and check the PHP and web server error logs after running your PHP tests.
262264
- Rebuild PHP with `--enable-zts` to check your change compiles and operates
263-
correctly in a thread safe PHP.
265+
correctly in a thread-safe PHP.
264266
- Review the change once more just before submitting it.
265267

266268
## What happens after submitting contribution?
267269

268270
If your change is easy to review and obviously has no side-effects, it might be
269271
committed relatively quickly.
270272

271-
Because PHP is a volunteer-driven effort more complex changes will require
273+
Because PHP is a volunteer-driven effort, more complex changes will require
272274
patience on your side. If you do not receive feedback in a few days, consider
273275
bumping. Before doing this think about these questions:
274276

275277
- Did I send the patch to the right mailing list?
276278
- Did I review the mailing list archives to see if these kind of changes had
277279
been discussed before?
278280
- Did I explain my change clearly?
279-
- Is my change too hard to review? Because of what factors?
281+
- Is my change too hard to review? If so, why?
280282

281283
## What happens when your contribution is applied?
282284

@@ -327,7 +329,8 @@ Currently we have the following branches in use:
327329

328330
| Branch | |
329331
| --------- | --------- |
330-
| master | Active development branch for PHP 8.1, which is open for backwards incompatible changes and major internal API changes. |
332+
| master | Active development branch for PHP 8.2, which is open for backwards incompatible changes and major internal API changes. |
333+
| PHP-8.1 | Is used to release the PHP 8.1.x series. This is a current stable version and is open for bugfixes only. |
331334
| PHP-8.0 | Is used to release the PHP 8.0.x series. This is a current stable version and is open for bugfixes only. |
332335
| PHP-7.4 | Is used to release the PHP 7.4.x series. This is a current stable version and is open for bugfixes only. |
333336
| PHP-7.3 | Is used to release the PHP 7.3.x series. This is a current stable version and is open for bugfixes only. |
@@ -398,9 +401,6 @@ Example:
398401
When you change the NEWS file for a bug fix, then please keep the bugs sorted in
399402
decreasing order under the fixed version.
400403

401-
You can use [gitweb](https://git.php.net/) to look at PHP Git repository in
402-
various ways.
403-
404404
## Copyright and license headers
405405

406406
New source code files should include the following header block:

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
--------------------------------------------------------------------
22
The PHP License, version 3.01
3-
Copyright (c) 1999 - 2019 The PHP Group. All rights reserved.
3+
Copyright (c) 1999 - 2021 The PHP Group. All rights reserved.
44
--------------------------------------------------------------------
55

66
Redistribution and use in source and binary forms, with or without

NEWS

+13-16
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,22 @@
11
PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3-
?? ??? ????, PHP 8.1.0alpha1
3+
?? ??? ????, PHP 8.2.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-
9-
- FTP:
10-
. Convert resource<ftp> to object \FTPConnection. (Sara)
5+
- CLI:
6+
. Fixed bug #81496 (Server logs incorrect request method). (lauri)
117

12-
- GD:
13-
. Convert resource<gd font> to object \GdFont. (Sara)
8+
- Core:
9+
. Fixed bug #81380 (Observer may not be initialized properly). (krakjoe)
1410

15-
- hash:
16-
. Implemented FR #68109 (Add MurmurHash V3). (Anatol, Michael)
11+
- Intl:
12+
. Update all grandfathered language tags with preferred values
1713

18-
- OpenSSL:
19-
. Bump minimal OpenSSL version to 1.0.2. (Jakub Zelenka)
14+
- OCI8:
15+
. Added oci8.prefetch_lob_size directive to tune LOB query performance
2016

21-
- PSpell:
22-
. Convert resource<pspell> to object \PSpell. (Sara)
23-
. Convert resource<pspell config> to object \PSPellConfig. (Sara)
17+
- Zip:
18+
. add ZipArchive::clearError() method
19+
. add ZipArchive::getStreamName() method
20+
. add ZipArchive::getStreamIndex() method
2421

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

README.md

+13-11
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ web development. Fast, flexible and pragmatic, PHP powers everything from your
1414
blog to the most popular websites in the world. PHP is distributed under the
1515
[PHP License v3.01](LICENSE).
1616

17-
[![Build status](https://travis-ci.org/php/php-src.svg?branch=master)](https://travis-ci.org/php/php-src)
17+
[![Build status](https://travis-ci.com/php/php-src.svg?branch=master)](https://travis-ci.com/php/php-src)
1818
[![Build status](https://ci.appveyor.com/api/projects/status/meyur6fviaxgdwdy/branch/master?svg=true)](https://ci.appveyor.com/project/php/php-src)
1919
[![Build Status](https://dev.azure.com/phpazuredevops/php/_apis/build/status/php.php-src?branchName=master)](https://dev.azure.com/phpazuredevops/php/_build/latest?definitionId=1&branchName=master)
2020
[![Fuzzing Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/php.svg)](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:php)
@@ -40,12 +40,17 @@ For other systems, see the [installation chapter](https://php.net/install).
4040
*For Windows, see [Build your own PHP on Windows](https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2).*
4141

4242
For a minimal PHP build from Git, you will need autoconf, bison, and re2c. For
43-
a default build, you will additionally need libxml2 and libsqlite3. On Ubuntu,
44-
you can install these using:
43+
a default build, you will additionally need libxml2 and libsqlite3.
44+
45+
On Ubuntu, you can install these using:
4546

4647
sudo apt install -y pkg-config build-essential autoconf bison re2c \
4748
libxml2-dev libsqlite3-dev
4849

50+
On Fedora, you can install these using:
51+
52+
sudo dnf install re2c bison autoconf make libtool ccache libxml2-devel sqlite-devel
53+
4954
Generate configure:
5055

5156
./buildconf
@@ -98,10 +103,8 @@ Extension Community Library - [PECL](https://pecl.php.net).
98103

99104
## Contributing
100105

101-
The PHP source code is located in the Git repository at
102-
[git.php.net](https://git.php.net). Contributions are most welcome by forking
103-
the [GitHub mirror repository](https://github.com/php/php-src) and sending a
104-
pull request.
106+
Contributions are most welcome by forking the
107+
[GitHub repository](https://github.com/php/php-src) and sending a pull request.
105108

106109
Discussions are done on GitHub, but depending on the topic can also be relayed
107110
to the official PHP developer mailing list [email protected].
@@ -122,9 +125,8 @@ ticket at [bugs.php.net](https://bugs.php.net) and reference the bug id using
122125
magic_quotes behavior and therefore should not raise a warning at any time.
123126
The patch removes this warning.
124127

125-
Pull requests are not merged directly on GitHub. All PRs will be pulled and
126-
pushed through [git.php.net](https://git.php.net). See
127-
[Git workflow](https://wiki.php.net/vcs/gitworkflow) for more details.
128+
See [Git workflow](https://wiki.php.net/vcs/gitworkflow) for more details on the
129+
pull request workflow.
128130

129131
### Guidelines for contributors
130132

@@ -133,7 +135,7 @@ contribute:
133135

134136
- [Contributing to PHP](/CONTRIBUTING.md)
135137
- [PHP coding standards](/CODING_STANDARDS.md)
136-
- [Mailinglist rules](/docs/mailinglist-rules.md)
138+
- [Mailing list rules](/docs/mailinglist-rules.md)
137139
- [PHP release process](/docs/release-process.md)
138140

139141
## Credits

0 commit comments

Comments
 (0)