Add recursion protection when emitting deprecation warnings for class
constants, since the deprecation message can come from an attribute that is
using the same constant for the message, or otherwise result in recursion.
But, internal constants are persisted, and thus cannot have recursion
protection. Otherwise, if a user error handler triggers bailout before the
recursion flag is removed then a subsequent request (e.g. with `--repeat 2`)
would start with that flag already applied. Internal constants can presumably
be trusted not to use deprecation messages that come from recursive attributes.
Fixes GH-18463
Fixes GH-17711
Introduces intl_convert_utf8_to_utf16_zstr() to convert a UTF-8 string
to a UTF-16 string zend_string* instance. This way we avoid a double
copy later from a UChar* into a zend_string*.
This aligns the behaviour with normal (non-intl) asort() by making the following changes:
- Use the same trailing whitespace logic as Zend's is_numeric_ex()
- Don't allow errors on trailing data
Targeting master because of the BC break.
Closes GH-18632.
UDP segmentation offload is an optimisation attempt by sending multiple
large enough datagrams over UDP which reduces syscalls as by default,
they have to be broke down in small UDP packets, it is better if the
hardware supports it, other handed down to the software implementation.
close GH-18213
This avoids temporary allocations and some copies.
For this benchmark:
```php
for ($i=0;$i<2000000;$i++) {
http_build_query([999999 => 'foo', 'aaab' => 'def', 'aaaaa'=>1, 'aaaaaaaa' => 'a']);
}
```
On an i7-4790:
```
Benchmark 1: ./sapi/cli/php ../buildquery.php
Time (mean ± σ): 298.9 ms ± 7.3 ms [User: 295.6 ms, System: 2.3 ms]
Range (min … max): 293.6 ms … 314.0 ms 10 runs
Benchmark 2: ./sapi/cli/php_old ../buildquery.php
Time (mean ± σ): 594.8 ms ± 8.6 ms [User: 590.8 ms, System: 2.4 ms]
Range (min … max): 586.3 ms … 616.1 ms 10 runs
Summary
./sapi/cli/php ../buildquery.php ran
1.99 ± 0.06 times faster than ./sapi/cli/php_old ../buildquery.php
```
For this benchmark:
```php
for ($i=0;$i<2000000;$i++) {
http_build_query(['test' => 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa']);
}
```
On an i7-4790:
```
Benchmark 1: ./sapi/cli/php ../buildquery.php
Time (mean ± σ): 188.4 ms ± 6.7 ms [User: 184.6 ms, System: 2.9 ms]
Range (min … max): 182.0 ms … 205.4 ms 14 runs
Benchmark 2: ./sapi/cli/php_old ../buildquery.php
Time (mean ± σ): 323.9 ms ± 8.7 ms [User: 319.8 ms, System: 2.7 ms]
Range (min … max): 318.0 ms … 341.2 ms 10 runs
Summary
./sapi/cli/php ../buildquery.php ran
1.72 ± 0.08 times faster than ./sapi/cli/php_old ../buildquery.php
```
This allows us to avoid a call to `zend_ini_str` which took 6% of the
profile on my i7-4790 for a call to `http_build_query`. Now we can just
grab the value from the globals.
In other files this can avoid some length recomputations.