1
0
mirror of https://github.com/php/php-src.git synced 2026-04-10 01:23:53 +02:00
Commit Graph

130976 Commits

Author SHA1 Message Date
Bob Weinand
f833a7ea59 Merge branch 'PHP-8.2' 2023-01-17 11:14:18 +01:00
Bob Weinand
a6a20c9e17 Add regression test for e560592a61
Reproduces only under ASAN.

Signed-off-by: Bob Weinand <bobwei9@hotmail.com>
2023-01-17 11:14:00 +01:00
Alex Dowad
b189aaacc2 Tweaks for accelerated implementation of mb_strlen for UTF-8
On longer strings, this gives a small speed boost of 10% or less.
2023-01-17 10:07:53 +02:00
Alex Dowad
3ae4779305 Add accelerated (SIMD-based) implementation of mb_check_encoding for UTF-8
The new SSE2-based implementation of mb_check_encoding for UTF-8 is
about 10% faster for 0-5 byte strings, more than 3 times faster for
~100-byte strings, and just under 4 times faster for ~10,000-byte
strings.

I believe it may be possible to make this function much faster again.
Some possible directions for further performance optimization include:

• If other ISA extensions like AVX or AVX-512 are available, use a
  similar algorithm, but process text in blocks of 32 or 64 bytes
  (instead of 16 bytes).
• If other SIMD ISA extensions are available, use the greater variety
  of available instructions to make some of the checks tighter.
• Even if only SSE/SSE2 are available, find clever ways to squeeze
  instructions out of the hot path. This would probably require a lot
  of perusing instruction mauals and thinking hard about which SIMD
  instructions could be used to perform the same checks with fewer
  instructions.
• Find a better algorithm, possibly one where more checks could be
  combined (just as the current algorithm combines the checks for
  certain overlong code units and reserved codepoints).
2023-01-17 10:07:53 +02:00
David Carlier
585ac794b4 Merge branch 'PHP-8.2' 2023-01-16 20:44:01 +00:00
David Carlier
385f410e4c Merge branch 'PHP-8.1' into PHP-8.2 2023-01-16 20:43:08 +00:00
Niels Dossche
dfe9c2af19 Fix incorrect comparison in block optimization pass
We're in the case of ZEND_JMPZ_EX or ZEND_JMPNZ_EX. The opcode gets
overwritten and only after the overwriting gets checked if we're in a
JMPZ or JMPNZ case. This results in a wrong optimization.

Close GH-10329
2023-01-16 20:41:33 +00:00
Bob Weinand
277dc35541 Merge branch 'PHP-8.2' 2023-01-16 17:39:34 +01:00
Petar Obradović
e560592a61 Fix GH-9675: Re-adjust run_time_cache init for internal enum methods
Closes GH-10143.
2023-01-16 17:38:38 +01:00
George Peter Banyard
6556601b45 Add some const qualifiers and better return types to zend_object_handlers.h (#10330)
I initially wanted to add them to the zend_strings but because they are used in zend_hash_find() which might modify the hash field.
2023-01-16 13:55:12 +00:00
Kamil Tekiela
da550e7762 MYSQL_ATTR_USE_BUFFERED_QUERY is a bool attribute (#10320) 2023-01-16 13:11:38 +00:00
Kamil Tekiela
38dfd20526 Remove main() from mysqli warning (#10321) 2023-01-16 13:10:27 +00:00
Niels Dossche
9006f06a84 Remove dead cleanup code (#10333)
This code path was only triggered if inst->cd == NULL. But the freeing
only happens if inst->cd != NULL. There is nothing to free here, so
remove this code. In fact, let's get rid of the goto too to make the
code more clear to read.
2023-01-16 12:54:35 +00:00
Dmitry Stogov
c010e8fb02 Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix GH-10271: Incorrect arithmetic calculations when using JIT
2023-01-16 14:52:14 +03:00
Dmitry Stogov
757e269b89 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-10271: Incorrect arithmetic calculations when using JIT
2023-01-16 14:51:42 +03:00
Dmitry Stogov
42eed7bb4e Fix GH-10271: Incorrect arithmetic calculations when using JIT 2023-01-16 14:51:26 +03:00
Christoph M. Becker
2d3427c507 Revert "#include cleanup (#10216)"
Cf. <https://github.com/php/php-src/pull/10220#issuecomment-1383739816>.

This reverts commit e628c66f9d.
2023-01-16 12:29:41 +01:00
Christoph M. Becker
c8955c078a Revert GH-10220
Cf. <https://github.com/php/php-src/pull/10220#issuecomment-1383739816>.

This reverts commit ecc880f491.
This reverts commit 588a07f737.
This reverts commit f377e15751.
This reverts commit b4ba16fe18.
This reverts commit 694ec1deea.
This reverts commit 6b34de8eba.
This reverts commit aa1cd02a43.
This reverts commit 308fd311ea.
This reverts commit 16203b53e1.
This reverts commit 738fb5ca54.
This reverts commit 9fdbefacd3.
This reverts commit cd4a7c1d90.
This reverts commit 928685eba2.
This reverts commit 01e5ffc85c.
2023-01-16 12:27:33 +01:00
Christoph M. Becker
2f4973fd88 Revert GH-10279
Cf. <https://github.com/php/php-src/pull/10220#issuecomment-1383739816>.

This reverts commit 45a128c9de.
This reverts commit 1eb71c3f15.
This reverts commit 492523a779.
This reverts commit c7a4633891.
This reverts commit 308adb915c.
This reverts commit cd27d5e07f.
This reverts commit c5933409b4.
This reverts commit 46371f4eb3.
This reverts commit 623e2e9fc6.
This reverts commit e7434c1247.
This reverts commit d28d323ca2.
This reverts commit 1a067b84ee.
This reverts commit a55c0c5fc3.
This reverts commit b5aeb3a4d4.
This reverts commit f061a035e4.
This reverts commit b088575119.
This reverts commit b1d48774a7.
This reverts commit 94f9a20ce6.
This reverts commit 4831e48708.
This reverts commit cd985de190.
This reverts commit 9521d21681.
This reverts commit d6136151e9.
2023-01-16 12:25:59 +01:00
Christoph M. Becker
bf1cfc0753 Revert GH-10300
Cf. <https://github.com/php/php-src/pull/10220#issuecomment-1383739816>.

This reverts commit 68ada76f9a.
his reverts commit 45384c6e20.
This reverts commit ef7fbfd710.
This reverts commit 9b9ea0d7c6.
This reverts commit f15747c26b.
This reverts commit e883ba93c4.
This reverts commit 7e87551c37.
This reverts commit 921274d2b8.
This reverts commit fc1f528e5e.
This reverts commit 0961715cda.
This reverts commit a93f264526.
This reverts commit 72dd94e1c6.
This reverts commit 29b2dc8964.
This reverts commit 05c7653bba.
This reverts commit 5190e5c260.
This reverts commit 6b55bf228c.
This reverts commit 184b4a12d3.
This reverts commit 4c31b7888a.
This reverts commit d44e9680f0.
This reverts commit 4069a5c43f.
2023-01-16 12:22:54 +01:00
Dmitry Stogov
889dba4016 Merge branch 'PHP-8.2'
* PHP-8.2:
  Revert "Merge branch 'PHP-8.0' into PHP-8.1"
2023-01-16 11:18:35 +03:00
Dmitry Stogov
4d8f409bfc Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Revert "Merge branch 'PHP-8.0' into PHP-8.1"
2023-01-16 11:18:15 +03:00
Dmitry Stogov
0d011e4626 Revert "Merge branch 'PHP-8.0' into PHP-8.1"
This reverts commit 0116864cd3, reversing
changes made to 1f715f5658.
2023-01-16 11:15:30 +03:00
George Peter Banyard
334ecbed5e Update UPGRADING.INTERNALS with the changes made to php_url_encode_hash_ex() 2023-01-15 16:10:14 +00:00
George Peter Banyard
540e5104df Drop key_suffix parameter in php_url_encode_hash_ex()
The suffix was always constant and the same value between calls and depends on a prefix being needed
2023-01-15 16:00:18 +00:00
George Peter Banyard
c9b8d1bfaa Use zend_string* instead of char* and size_t pair for key_prefix 2023-01-15 16:00:18 +00:00
George Peter Banyard
76eaff080a Use a zend_string* for arg_sep in php_url_encode_hash_ex()
This prevent a repeated strlen() call for known information
2023-01-15 16:00:18 +00:00
George Peter Banyard
098a43dbd0 Introduce new INI API to get zend_string* value for an INI setting 2023-01-15 16:00:18 +00:00
George Peter Banyard
20a6638e22 Extract scalar url encoding into its own function 2023-01-15 16:00:18 +00:00
George Peter Banyard
7d33a30b40 Handle floats directly in http_build_query() 2023-01-15 16:00:17 +00:00
George Peter Banyard
ec7c7a7550 Add more tests for http_build_query()
Some with unusual types like resource and null
A lot more tests for objects
2023-01-15 16:00:17 +00:00
George Peter Banyard
c177ea91d4 Move http_build_query() tests to the HTTP test folder 2023-01-15 16:00:17 +00:00
George Peter Banyard
5624cbbed1 Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix wrong flags check for compression method in phar_object.c
  Fix missing check for xmlTextWriterEndElement
  Fix substr_replace with slots in repl_ht being UNDEF
2023-01-15 15:43:57 +00:00
George Peter Banyard
ec377c687d Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix wrong flags check for compression method in phar_object.c
  Fix missing check for xmlTextWriterEndElement
  Fix substr_replace with slots in repl_ht being UNDEF
2023-01-15 15:43:34 +00:00
Niels Dossche
347b7c3628 Fix wrong flags check for compression method in phar_object.c
I found this issue using static analysis tools, it reported that the condition was always false.
We can see that flags is assigned in the switch statement above, but a mistake was made in the comparison.

Closes GH-10328

Signed-off-by: George Peter Banyard <girgias@php.net>
2023-01-15 15:35:35 +00:00
Niels Dossche
11a1feb0d7 Fix missing check for xmlTextWriterEndElement
xmlTextWriterEndElement returns -1 if the call fails. There was already
a check for retval, but the return value wasn't assigned to retval. The
other caller of xmlTextWriterEndElement is in
xmlwriter_write_element_ns, which does the check correctly.

Closes GH-10324

Signed-off-by: George Peter Banyard <girgias@php.net>
2023-01-15 15:34:43 +00:00
Niels Dossche
4bbbe6d652 Fix substr_replace with slots in repl_ht being UNDEF
The check that was supposed to check whether the array slot was UNDEF
was wrong and never triggered. This resulted in a replacement with the
empty string or the wrong string instead of the correct one. The correct
check pattern can be observed higher up in the function's code.

Closes GH-10323

Signed-off-by: George Peter Banyard <girgias@php.net>
2023-01-15 15:31:34 +00:00
Max Kellermann
68ada76f9a Zend/zend_closures: include cleanup 2023-01-15 15:07:58 +00:00
Max Kellermann
45384c6e20 Zend/zend_inheritance: include cleanup 2023-01-15 15:07:58 +00:00
Max Kellermann
ef7fbfd710 Zend/zend_API: include cleanup 2023-01-15 15:07:58 +00:00
Max Kellermann
9b9ea0d7c6 Zend/zend_list: include cleanup 2023-01-15 15:07:58 +00:00
Max Kellermann
f15747c26b Zend/zend_objects: include cleanup 2023-01-15 15:07:58 +00:00
Max Kellermann
e883ba93c4 Zend/zend_gc: include cleanup 2023-01-15 15:07:58 +00:00
Max Kellermann
7e87551c37 Zend/zend_llist: include cleanup 2023-01-15 15:07:58 +00:00
Max Kellermann
921274d2b8 Zend/zend_observer: include cleanup 2023-01-15 15:07:58 +00:00
Max Kellermann
fc1f528e5e Zend/zend_interfaces: include cleanup 2023-01-15 15:07:58 +00:00
Max Kellermann
0961715cda Zend/zend_enum: include cleanup 2023-01-15 15:07:58 +00:00
Max Kellermann
a93f264526 Zend/zend_weakrefs: include cleanup 2023-01-15 15:07:58 +00:00
Max Kellermann
72dd94e1c6 Zend/zend_compile: include cleanup 2023-01-15 15:07:58 +00:00
Max Kellermann
29b2dc8964 Zend/zend_iterators: include cleanup 2023-01-15 15:07:58 +00:00