Commit graph

129320 commits

Author SHA1 Message Date
Christoph M. Becker
31a99331c1
Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix GH-9266: GC root buffer keeps growing when dtors are present
2022-08-09 14:16:35 +02:00
Michael Olšavský
0709578517
Fix GH-9266: GC root buffer keeps growing when dtors are present
Do not reset cleared count on GC rerun.

Closes GH-9265.
2022-08-09 14:16:11 +02:00
dixyes
3a843f953b
Windows arm64 zend and standard extension support
* Port zend_cpuid for windows arm64
* Fix zend_atomic windows arm64 build
* Fix windows arm64 multiply
* Enable arm64 neon for windows in standard extension
* Enable arm64 neon for windows in zend_hash.c
* Workaround for msvc arm64 optimization bug

Closes GH-9115.
2022-08-09 12:45:14 +02:00
Máté Kocsis
aeabb51ae4
Declare ext/intl constants in stubs - part 9 (#9276) 2022-08-09 11:32:06 +02:00
Máté Kocsis
08748577c0
Declare ext/intl constants in stubs - part 8 (#9275) 2022-08-09 11:29:26 +02:00
Máté Kocsis
383eefa9e4
Declare ext/intl constants in stubs - part 11 (#9281) 2022-08-09 11:28:18 +02:00
Máté Kocsis
bc4c11ab14
Declare ext/intl constants in stubs - part 12 (#9282) 2022-08-09 11:27:41 +02:00
Máté Kocsis
559d5030a8
Declare ext/intl constants in stubs - part 10 (#9280) 2022-08-09 11:19:23 +02:00
Tyson Andre
6a50af2604
Make "{$g{'h'}}" emit fatal error and no incorrect deprecation notice in 8.2 (#9264)
The ast node flag constants ZEND_DIM_ALTERNATIVE_SYNTAX and
ZEND_ENCAPS_VAR_DOLLAR_CURLY_VAR_VAR node have identical values (1<<1),
causing a deprecation notice to be incorrectly emitted before the fatal error
for unsupported syntax.

Fixes GH-9263

Explicitly check for AST_VAR/AST_DIM kind for future compatibility

`AST_PROP`/`AST_METHOD_CALL` and nullsafe variants can also be found in
encapsulated strings - currently they have no flags but they may have flags in
the future. This also clarifies that this deprecation warning can only happen
for AST_VAR/AST_DIM nodes for certain `attr` values.
2022-08-08 19:41:32 -04:00
Christoph M. Becker
d013d94985
Fix GH-9248: Segmentation fault in mb_strimwidth()
We need to initialize the optional argument `trimmarker` with its
default value.

Closes GH-9273.
2022-08-08 18:35:37 +02:00
Máté Kocsis
8fee9a3f11
Declare ext/intl constants in stubs - part 7 (#9269) 2022-08-08 14:24:22 +02:00
Máté Kocsis
d97f8eef33
Declare ext/intl constants in stubs - part 6 (#9268) 2022-08-08 14:21:48 +02:00
Máté Kocsis
614e9ec804
Declare ext/intl constants in stubs - part 5 (#9267) 2022-08-08 12:00:10 +02:00
Máté Kocsis
c1da9e7964
Declare ext/intl constants in stubs - part 4 (#9234) 2022-08-08 08:56:51 +02:00
Máté Kocsis
163a278a02
Declare ext/intl constants in stubs - part 3 (#9233) 2022-08-08 08:28:40 +02:00
Jakub Zelenka
80197c59ec
Merge branch 'PHP-8.1' 2022-08-07 14:22:33 +01:00
Jakub Zelenka
c9fa98a174
Merge branch 'PHP-8.0' into PHP-8.1 2022-08-07 14:21:39 +01:00
Jakub Zelenka
d9ff5e079f
Fix GH-8472: stream_socket_accept result may have incorrect metadata 2022-08-07 14:17:38 +01:00
Ilija Tovilo
2650340b94
[skip ci] Also update message in feature closer 2022-08-06 21:17:36 +02:00
Ilija Tovilo
8438ad6d6b
[skip ci] Bump days-before-close to 14 days in stale feature closer 2022-08-06 21:16:28 +02:00
Christoph M. Becker
ad04345eb3
Fix GH-9244: Segfault with array_multisort + array_shift
After restructuring non-packed arrays, we either need to pack them if
possible, or to rehash them.

Closes GH-9247.
2022-08-05 17:09:54 +02:00
Ilija Tovilo
a6f489b452
Fix mb_strimwidth RC info
Closes GH-9254
2022-08-05 17:06:23 +02:00
zeriyoshi
19eecf16aa [ci skip] update NEWS
--CGI-- fixes for PHP 8.1 / 8.0
30ed8fb32d
2022-08-06 00:03:57 +09:00
Christoph M. Becker
8c0cdd1d6c
[ci skip] Remove outdated info from php.ini templates
There is no more need to tell users about PHP 5, or even PHP 4.

Closes GH-9256.
2022-08-05 16:48:08 +02:00
Christoph M. Becker
ce6277986c
[ci skip] Add extension=zip to the php.ini templates
The zip extension is now built as shared library by default, so users
want to load it via php.ini.
2022-08-05 16:17:30 +02:00
Tim Düsterhus
1cd2d731ef
Handle all-zero state in Xoshiro256** (#9250)
- Retry if the CSPRNG generates a zero state.
- Throw ValueError if the user passes a zero state.

Fixes GH-9249
2022-08-05 14:38:57 +02:00
David CARLIER
f51fbf9fc4
zend allocators adding __declspec allocator for windows. (#9253)
does not affect the performance, however making those custom calls more meaningful
 for Event Tracing/Visual Studio.
2022-08-05 12:26:35 +01:00
Michael Voříšek
bd3cd6a41a
Fix unstable sapi test, fix GH-9140 (#9184) 2022-08-04 22:35:44 +01:00
sji
038c451c22
[ci skip] NEWS and UPGRADING for constants in traits (#9251)
see GH-8888
2022-08-04 23:18:50 +02:00
sji
3b62d66098
Implement constants in traits (#8888)
RFC: https://wiki.php.net/rfc/constants_in_traits
2022-08-04 20:08:40 +01:00
Tim Düsterhus
a191710a21
[ci skip] Run dos2unix on ext/random tests
One test inconsistently had CRLF newlines.
2022-08-04 21:01:04 +02:00
zeriyoshi
487f74c69a Merge branch 'PHP-8.1' 2022-08-05 02:24:17 +09:00
zeriyoshi
4d7ccbb69f Merge branch 'PHP-8.0' into PHP-8.1 2022-08-05 02:23:44 +09:00
Go Kudo
a807092c18
CI: macos-10.15 -> macos-11 (#9087)
macOS-10.15 deprecated and remove soon GitHub Actions.
We needs migrate to macos-11 (Big Sur)
2022-08-05 02:23:00 +09:00
Bob Weinand
da94baf31a Add proper handling to observe functions in fibers
The current_observed_frame is carried along the fiber context and thus always correct now.

Signed-off-by: Bob Weinand <bobwei9@hotmail.com>
2022-08-04 17:16:27 +02:00
Bob Weinand
dc5475c191 Save previous observer on the VM stack
This avoids a possible significant performance penalty, when some leaf function was observed, deep in the stack.
As a side effect, we are not iterating over prev_execute_data anymore and thus, non-observed fake frames, possibly on stack, cannot have any impact on the observer anymore (especially within zend_observer_fcall_end_all).

Saving the previous observer happens now directly on the VM stack. If there is any observer, function frames are allocated an extra zval (the last temporary), which will, on observed frames, contain the previous observed frame address.
2022-08-04 17:16:27 +02:00
zeriyoshi
30ed8fb32d Merge remote-tracking branch 'upstream/PHP-8.1' 2022-08-05 00:08:36 +09:00
zeriyoshi
2d777466c0 Merge remote-tracking branch 'upstream/PHP-8.0' into PHP-8.1 2022-08-05 00:06:04 +09:00
zeriyoshi
1ce2b56227 [CI skip] update NEWS 2022-08-05 00:05:12 +09:00
Go Kudo
3725717de1
Remove ZEND_DVAL_TO_LVAL_CAST_OK (#9215)
* Remove ZEND_DVAL_TO_LVAL_CAST_OK
As far as I can see, this operation should always use the _slow method, and the results seem to be wrong when ZEND_DVAL_TO_LVAL_CAST_OK is enabled.

* update NEWS
2022-08-04 23:56:19 +09:00
Christoph M. Becker
f11228cdbe
Add conflict markers for dba tests
These tests use the same filename, and as such must not be run in
parallel.
2022-08-04 16:23:26 +02:00
George Peter Banyard
faa83f2f34
Convert some macros to zend_always_inline functions (#8288)
This doesn't have an effect really, but humans and IDEs can struggle to see through the macro soup when they first interact with PHP's source code.

Moreover, this reduces some of the macro expansion hell when they appear in compiler warnings.
2022-08-04 13:24:12 +01:00
Christoph M. Becker
55f8c14224
Avoid unnecessary comparison
The first element of the `arrays` serves as base for the comparison, so
there is no need to compare it to itself.

Closes GH-9246.
2022-08-04 14:19:51 +02:00
Ilija Tovilo
3663f7661a
DIM on null in const expr should emit warning 2022-08-04 11:24:16 +02:00
Ilija Tovilo
7b43d819c8
Also fix ?-> on magic consts in const expressions
Fixes GH-9136
Fixes GH-9138
2022-08-03 23:40:06 +02:00
Tim Düsterhus
60ace13f9c
Fix undefined behavior of MT_RAND_PHP if range exceeds ZEND_LONG_MAX (#9197)
RAND_RANGE_BADSCALING() invokes undefined behavior when (max - min) >
ZEND_LONG_MAX, because the intermediate `double` might not fit into
`zend_long`.

Fix this by inlining a fixed version of the macro into Mt19937's range()
function. Fixing the macro itself cannot be done in the general case, because
the types of the inputs are not known. Instead of replacing one possibly broken
version with another possibly broken version, the macro is simply left as is
and should be removed in a future version.

The fix itself is simple: Instead of storing the "offset" in a `zend_long`, we
use a `zend_ulong` which is capable of storing the resulting double by
construction. With this fix the implementation of this broken scaling is
effectively identical to the implementation of php_random_range from a data
type perspective, making it easy to verify the correctness.

It was further empirically verified that the broken macro and the fix return
the same results for all possible values of `r` for several distinct pairs of
(min, max).

Fixes GH-9190
Fixes GH-9191
2022-08-03 18:46:36 +02:00
Tim Düsterhus
3331832b04
Add ext/random Exception hierarchy (#9220)
* Add Random\Random{Error,Exception} and Random\BrokenRandomEngineError

* Throw BrokenRandomEngineError

* Throw RandomException on seeding failure

* Throw RandomException when CSPRNG fails

* Remove unused include from ext/random/engine_combinedlcg.c

* Remove unused include from ext/random/engine_secure.c

* Remove unused include from ext/random/random.c

* [ci skip] Add ext/random Exception hierarchy to NEWS

* [ci skip] Add the change of Exception for random_(int|bytes) to UPGRADING
2022-08-02 20:04:28 +02:00
Jakub Zelenka
dc01fce36d Fix GH-8396: Network online test using https broken 2022-08-02 18:50:42 +01:00
Jakub Zelenka
e5ab9f45d5
Fix bug #65489: glob() basedir check is inconsistent
This removes the inconsistent and incorrectly working open basedir check
on pattern in glob. It means that an empty array will be returned even
if the whole pattern is outside the open basedir restriction.
2022-08-02 18:36:29 +01:00
Tim Düsterhus
db84e44607
Fix PcgOneseq128XslRr64::__construct() definition in random.stub.php (#9235)
* Fix PcgOneseq128XslRr64::__construct() definition in random.stub.php

The second parameter does not actually exist for a Oneseq PCG. It was removed
from the RFC before it went into voting.

* [ci skip] Add PcgOneseq128XslRr64 stub fix to NEWS
2022-08-02 18:54:39 +02:00