1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/UPGRADING
Niels Dossche 540fd6e96b dom: Optimize splitText() (#20371)
This avoids duplicating the intermediate strings, by transferring
ownership.

It's hard to measure the improvement in a reliable way, as we have to
operate on the same node. The following benchmark shows a nice
improvement (although not perfect as a benchmark):
```php
<?php

$dom = new DOMDocument;
$dom->loadXML('<root>testabcdef</root>');
$text = $dom->documentElement->firstChild;

for ($i = 0; $i < 1000000; $i++) {
    $text2 = clone $text;
    $text2->splitText(5);
}
```

Only tested on my desktop i7-4790:
```
Benchmark 1: ./sapi/cli/php x.php
  Time (mean ± σ):     284.1 ms ±   2.8 ms    [User: 280.0 ms, System: 3.0 ms]
  Range (min … max):   281.4 ms … 291.3 ms    10 runs

Benchmark 2: ./sapi/cli/php_old x.php
  Time (mean ± σ):     314.0 ms ±   7.8 ms    [User: 309.2 ms, System: 2.9 ms]
  Range (min … max):   306.5 ms … 328.0 ms    10 runs

Summary
  ./sapi/cli/php x.php ran
    1.11 ± 0.03 times faster than ./sapi/cli/php_old x.php
```
2025-11-03 18:46:56 +01:00

125 lines
3.8 KiB
Plaintext

PHP 8.6 UPGRADE NOTES
1. Backward Incompatible Changes
2. New Features
3. Changes in SAPI modules
4. Deprecated Functionality
5. Changed Functions
6. New Functions
7. New Classes and Interfaces
8. Removed Extensions and SAPIs
9. Other Changes to Extensions
10. New Global Constants
11. Changes to INI File Handling
12. Windows Support
13. Other Changes
14. Performance Improvements
========================================
1. Backward Incompatible Changes
========================================
- Phar:
. Invalid values now throw in Phar::mungServer() instead of being silently
ignored.
========================================
2. New Features
========================================
- Core:
. It is now possible to use reference assign on WeakMap without the key
needing to be present beforehand.
- Intl:
. Added IntlNumberRangeFormatter class to format an interval of two numbers with a given skeleton, locale, IntlNumberRangeFormatter::COLLAPSE_AUTO, IntlNumberRangeFormatter::COLLAPSE_NONE, IntlNumberRangeFormatter::COLLAPSE_UNIT, IntlNumberRangeFormatter::COLLAPSE_ALL collapse and
IntlNumberRangeFormatter::IDENTITY_FALLBACK_SINGLE_VALUE, IntlNumberRangeFormatter::IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE, IntlNumberRangeFormatter::IDENTITY_FALLBACK_APPROXIMATELY and
IntlNumberRangeFormatter::IDENTITY_FALLBACK_RANGE identity fallbacks.
It is supported from icu 63.
- Streams:
. Added stream socket context option so_reuseaddr that allows disabling
address reuse (SO_REUSEADDR) and explicitly uses SO_EXCLUSIVEADDRUSE on
Windows.
========================================
3. Changes in SAPI modules
========================================
========================================
4. Deprecated Functionality
========================================
========================================
5. Changed Functions
========================================
- Phar:
. Phar::mungServer() now supports reference values.
- Zip:
. ZipArchive::extractTo now raises a TypeError for the
files argument if one or more of the entries is not
a string.
========================================
6. New Functions
========================================
========================================
7. New Classes and Interfaces
========================================
========================================
8. Removed Extensions and SAPIs
========================================
========================================
9. Other Changes to Extensions
========================================
- Hash:
. The bundled version of xxHash was upgraded to 0.8.2.
========================================
10. New Global Constants
========================================
========================================
11. Changes to INI File Handling
========================================
- Mysqli:
. mysqli.default_port now checks the validity of the value which should be
between 0 and 65535 included.
- Opcache:
. opcache.jit_debug accepts a new flag: ZEND_JIT_DEBUG_TRACE_EXIT_INFO_SRC.
When used along with ZEND_JIT_DEBUG_TRACE_EXIT_INFO, the source of exit
points is printed in exit info output, in debug builds.
========================================
12. Windows Support
========================================
========================================
13. Other Changes
========================================
========================================
14. Performance Improvements
========================================
- Core:
. `printf()` using only `%s` and `%d` will be compiled into the equivalent
string interpolation, avoiding the overhead of a function call and repeatedly
parsing the format string.
. Arguments are now passed more efficiently to known constructors (e.g. when
using new self()).
- DOM:
. Made splitText() faster and consume less memory.
- JSON:
. Improve performance of encoding arrays and objects.