TIDY_APPLY_CONFIG can early return because it's a macro, but then the
cleanup paths are not executed. Transform this to a real function and
handle the cleanups correctly at the callsites.
Closes GH-15046.
I don't know why this code was here in the first place, it is present
since the initial implementation. It doesn't make sense because:
1. It would require updating the refcounts if the document wasn't
actually already set.
2. We enforce that the document is the same as the target document by
this point, so setting the tree is pointless.
AIX 7.1 has SOCK_CONN_DGRAM, but not SOCK_DCCP; the previous change
conflated the availability between the two definitions. Add an
additional #ifdef for this.
Quoted m4_normalize will expand and change its argument later in the
macro call when M4 is processing the *.m4 sources. Without quotes the
already normalized string is passed to the macro directly. In these
specific cases generated configure script is the same. This is more for
consistency to have this synced and not repeat the pattern too much
in the future when copy/pasting. Note, that many AC_* macros require
similar behavior already (for example, AC_CHECK_FUNCS.)
The Windows CI of the `PHP-8.2` to `PHP-8.3` branches still use the
`php-sdk-2.2.0` which is almost five years old, and does not fetch the
updated dependencies from https://downloads.php.net/~windows.
The `master` branch CI uses `php_downloads_server_migration_v1`, which
has been superseded a few months ago[1]. So switching to the
`php-sdk-2.3.0` makes sense there, too.
[1] <php/php-sdk-binary-tools@19c8ccb>
Closes GH-14991.
The zend_object.properties HashTable needs to be built just in time by calling
rebuild_object_properties() on the object before accessing it. Normally this is
done automatically in zend_std_get_properties(), but we do it manually in a few
places.
In this change I introduce an inline variant of zend_std_build_properties(), and
refactor these places to use it instead of calling rebuild_object_properties()
manually.
rebuild_object_properties() renamed as rebuild_object_properties_internal(), to
enforce usage of zend_std_get_properties() or zend_std_build_properties_ex().
Closes GH-14996
This introduces a new helper php_dom_create_nullable_object() that does
the NULL check and puts NULL in return_value. Otherwise it runs
php_dom_create_object(). This deduplicates a bit of code.
Use our own string builder instead of using libxml's and then having to
copy over.
For the following test:
```
$dom = Dom\HTMLDocument::createEmpty();
$root = $dom->appendChild($dom->createElement('root'));
$root->append('abc', 'def', 'ghi');
$f = $root->firstChild;
for ($i = 0; $i < 1000000; $i++)
$f->wholeText;
```
The following results were obtained on an i7-4790:
```
Benchmark 1: ./sapi/cli/php x.php
Time (mean ± σ): 57.2 ms ± 2.3 ms [User: 53.2 ms, System: 3.4 ms]
Range (min … max): 54.7 ms … 69.3 ms 52 runs
Benchmark 2: ./sapi/cli/php_old x.php
Time (mean ± σ): 89.4 ms ± 3.4 ms [User: 85.6 ms, System: 3.0 ms]
Range (min … max): 86.1 ms … 105.8 ms 32 runs
Summary
./sapi/cli/php x.php ran
1.56 ± 0.09 times faster than ./sapi/cli/php_old x.php
```
This reverts commit 4b22c3e3ad.
As quick measure for GH-10753, that test was skipped on Windows.
However, it seems that there are no longer performance issues with
newer cURL versions, so we run that test again on Windows.
Fixes GH-10753.
Closes GH-14998.
This is mostly about mentioning that VLAs which are a required part of
C99 conforming implementations (although made optional in the C11
standard) *must* *not* be used in php-src.
It's indeed possible this is NULL. When you create a new text-like node
in libxml and pass NULL as content, you do get NULL in the content field
instead of the empty string. You can hit this by creating DOMText or
DOMComment directly and not passing any argument. This could also be
created internally.
We refactor the code such that this detail is hidden and we add a test
to check that it correctly throws an exception.
* zend build making sigjmp_buf and api check as mandatory.
all unixes support it since long time, the few which don't do not meet
the requirements to build php anyway (minix, dietlibc, ...).