]> granicus.if.org Git - php/log
php
4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Wed, 10 Feb 2021 11:21:15 +0000 (12:21 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Make finfo_open() $magic_database nullable

4 years agoMake finfo_open() $magic_database nullable
Nikita Popov [Wed, 10 Feb 2021 11:18:42 +0000 (12:18 +0100)]
Make finfo_open() $magic_database nullable

Empty string was interpreted as a special value here, which indicates
that the default magic database should be used. It makes more sense
to use null for this purpose.

The documentation also explicitly mentions that null can be used.

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Wed, 10 Feb 2021 11:04:05 +0000 (12:04 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Don't pass null action to __doRequest

4 years agoDon't pass null action to __doRequest
Nikita Popov [Wed, 10 Feb 2021 11:00:20 +0000 (12:00 +0100)]
Don't pass null action to __doRequest

The parameter is not nullable, so it will be interpreted as
an empty string anyway.

The entire code here is pretty confusing though, and probably
deserves a second loop. The HTTP code only send SOAPAction/action
if soapaction is non-NULL -- but it always is, because it is
accepted through a non-nullable string parameter.

Regarding the SOAPAction header, it appears that always sending
it is actually a requirement of the standard:
> An HTTP client MUST use this header field when issuing a SOAP
> HTTP Request.
Although it does make a distinction between absence of value and
an empty string:
> The header field value of empty string ("") means that the intent
> of the SOAP message is provided by the HTTP Request-URI. No value
> means that there is no indication of the intent of the message.
The empty string interpretation appears to be the desired one.

However, for the action MIME tag the SOAP 1.2 Part 2 specification
says that
> The media type specifies an optional action parameter, which can
> be used to optimize dispatch or routing, among other things.
but also
> The SOAP Action feature defines a single property, which is
> described in Table 14. The value of this property MUST be an
> absolute URI[RFC 3986] and MUST NOT be empty.
which would indicate that we should not be sending an empty
action here.

As I'm not familiar with SOAP and this is long-standing behavior,
I'm just leaving this alone for now...

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Wed, 10 Feb 2021 10:19:15 +0000 (11:19 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Clarify that location is required in do_request
  Regenerate arginfo file

4 years agoClarify that location is required in do_request
Nikita Popov [Wed, 10 Feb 2021 10:18:20 +0000 (11:18 +0100)]
Clarify that location is required in do_request

As far as I can tell, the location is always non-null here,
and the code wouldn't be able to meaningfully work without a
location.

4 years agoRegenerate arginfo file
Nikita Popov [Wed, 10 Feb 2021 10:18:06 +0000 (11:18 +0100)]
Regenerate arginfo file

Somehow missed this in the previous commit.

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Wed, 10 Feb 2021 09:52:28 +0000 (10:52 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Accept null $location in SoapClient::__setLocation()

4 years agoAccept null $location in SoapClient::__setLocation()
Nikita Popov [Wed, 10 Feb 2021 09:50:42 +0000 (10:50 +0100)]
Accept null $location in SoapClient::__setLocation()

Currently an empty string is used to unset the location. Once
again, it makes more sense to use a null value for this purpose
(though the special behavior of empty strings is retained).

The code comment above the function also explicitly indicates
that null should be accepted, and the function does return null
rather than an empty string for the old location value (if it
is missing).

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Wed, 10 Feb 2021 09:37:53 +0000 (10:37 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Make SoapVar arguments nullable

4 years agoMake SoapVar arguments nullable
Nikita Popov [Wed, 10 Feb 2021 09:36:32 +0000 (10:36 +0100)]
Make SoapVar arguments nullable

$typeName, $typeNamespace, $nodeName and $nodeNamespace all
special-case the empty string and don't set the property entirely
in that case. It makes more sense to use null to indicate absence
here (though of course the empty string behavior is retained).

4 years agoMerge branch 'PHP-8.0'
Máté Kocsis [Tue, 9 Feb 2021 21:42:48 +0000 (22:42 +0100)]
Merge branch 'PHP-8.0'

4 years agoAdd missing classes to stubs
Máté Kocsis [Tue, 9 Feb 2021 21:38:06 +0000 (22:38 +0100)]
Add missing classes to stubs

4 years agoOptimize ZEND_COUNT opcodes on arrays in the jit
Tyson Andre [Sat, 16 May 2020 21:32:16 +0000 (17:32 -0400)]
Optimize ZEND_COUNT opcodes on arrays in the jit

Avoid the overhead of a call and checking types
when the argument is definitely an array.
Avoid the overhead of gc when `__destruct` won't get called.

This seemed cheap enough to check for in the jit.

Because of https://wiki.php.net/rfc/restrict_globals_usage
we can be sure in the ZEND_COUNT handler that the array count does not have to
be recomputed in php 8.1.

The below example took 0.854 seconds before the optimization,
and 0.564 seconds after the optimization, giving the same result

```php
<?php
/** @jit */
function bench_count(int $n): int {
    $total = 0;
    $arr = [];
    for ($i = 0; $i < $n; $i++) {
        $arr[] = $i;
        $total += count($arr);
    }
    return $total;
}

function main() {
    $n = 1000;
    $iterations = 50000;
    $start = microtime(true);
    $result = 0;
    for ($i = 0; $i < $iterations; $i++) {
        $result += bench_count($n);
    }
    $elapsed = microtime(true) - $start;

    printf("Total for n=%d, iterations=%d = %d, elapsed=%.3f\n", $n, $iterations, $result, $elapsed);
}
main();
```

Before

```asm
mov $0x7feb8cf8a858, %r15
mov $ZEND_COUNT_SPEC_CV_UNUSED_HANDLER, %rax
call *%rax
```

After

```asm
mov 0x70(%r14), %rdi - Copy the count from the `zend_array*` pointer
mov %rdi, (%rax)     - Store the count in the destination's value
mov $0x4, 0x8(%rax)  - Store IS_LONG(4) in the destination's type
```

And add tracing jit support

Closes GH-5584

4 years agoUse IS_ALIAS_PTR to make distinct between aliasses and real classes
Dmitry Stogov [Tue, 9 Feb 2021 21:00:55 +0000 (00:00 +0300)]
Use IS_ALIAS_PTR to make distinct between aliasses and real classes

4 years agoAdded Inheritance Cache.
Dmitry Stogov [Tue, 9 Feb 2021 19:53:57 +0000 (22:53 +0300)]
Added Inheritance Cache.

This is a new transparent technology that eliminates overhead of PHP class inheritance.

PHP  classes are compiled and cached (by opcahce) separately, however their "linking" was done at run-time - on each request. The process of "linking" may involve a number of compatibility checks and borrowing methods/properties/constants form parent and traits. This takes significant time, but the result is the same on each request.

Inheritance Cache performs "linking" for unique set of all the depending classes (parent, interfaces, traits, property types, method types involved into compatibility checks) once and stores result in opcache shared memory. As a part of the this patch, I removed limitations for immutable classes (unresolved constants, typed properties and covariant type checks). So now all classes stored in opcache are "immutable". They may be lazily loaded into process memory, if necessary, but this usually occurs just once (on first linking).

The patch shows 8% improvement on Symphony "Hello World" app.

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Tue, 9 Feb 2021 14:19:56 +0000 (15:19 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Properly check imagegd() signature
  Make imagegd $file parameter nullable

4 years agoProperly check imagegd() signature
Nikita Popov [Tue, 9 Feb 2021 14:18:59 +0000 (15:18 +0100)]
Properly check imagegd() signature

Unlike imagegd2(), this function only accepts two parameters,
so we should be checking for that.

4 years agoMake imagegd $file parameter nullable
Nikita Popov [Tue, 9 Feb 2021 14:15:20 +0000 (15:15 +0100)]
Make imagegd $file parameter nullable

It is explicitly documented to be nullable, and this matches other
functions like imagepng. It is also documented to accept a stream,
which it currently does not...

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Tue, 9 Feb 2021 13:37:41 +0000 (14:37 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Use E_ERROR to report arginfo/zpp mismatch
  Make NumberFormatter ctor $pattern nullable
  Make IntlDateFormatter ctor $pattern nullable

4 years agoUse E_ERROR to report arginfo/zpp mismatch
Nikita Popov [Tue, 9 Feb 2021 13:32:17 +0000 (14:32 +0100)]
Use E_ERROR to report arginfo/zpp mismatch

When E_CORE_ERROR is used, we don't get correct file/line information.

4 years agoMake NumberFormatter ctor $pattern nullable
Nikita Popov [Tue, 9 Feb 2021 13:18:18 +0000 (14:18 +0100)]
Make NumberFormatter ctor $pattern nullable

Whether the pattern is needed depends on the used style. If no
pattern is needed, null is a more sensible value than an empty
string.

fixup

4 years agoMake IntlDateFormatter ctor $pattern nullable
Nikita Popov [Tue, 9 Feb 2021 13:23:42 +0000 (14:23 +0100)]
Make IntlDateFormatter ctor $pattern nullable

The implementation already made this argument nullable, but it
was not reflected in the stub.

4 years agoRemove a few more unnecessary @generate-function-entries annotations
Máté Kocsis [Tue, 9 Feb 2021 12:34:25 +0000 (13:34 +0100)]
Remove a few more unnecessary @generate-function-entries annotations

4 years agoGenerate ext/intl class entries from stubs
Máté Kocsis [Fri, 5 Feb 2021 19:57:57 +0000 (20:57 +0100)]
Generate ext/intl class entries from stubs

Closes GH-6670

4 years agoImplicitly enable function entry generation when class entry generation is enabled
Máté Kocsis [Mon, 8 Feb 2021 19:08:11 +0000 (20:08 +0100)]
Implicitly enable function entry generation when class entry generation is enabled

Closes GH-6675

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Tue, 9 Feb 2021 11:57:58 +0000 (12:57 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Make Phar $fileNotFoundScript nullable

4 years agoMake Phar $fileNotFoundScript nullable
Nikita Popov [Tue, 9 Feb 2021 11:55:33 +0000 (12:55 +0100)]
Make Phar $fileNotFoundScript nullable

While "" is already treated the same way as absence, null is the
logically correct default here. Making this one argument non-nullable
is particularly pecular when considering that the preceding $alias
and $index arguments are both nullable.

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Tue, 9 Feb 2021 11:29:50 +0000 (12:29 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Make createDocument() $namespace nullable

4 years agoMake createDocument() $namespace nullable
Nikita Popov [Tue, 9 Feb 2021 11:28:28 +0000 (12:28 +0100)]
Make createDocument() $namespace nullable

According to the DOM specification, this argument should be
nullable. It's also supposed to be a required argument, but
not changing that at this point.

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Tue, 9 Feb 2021 11:20:56 +0000 (12:20 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Make getElementsByTagNameNS $namespace nullable

4 years agoMake getElementsByTagNameNS $namespace nullable
Nikita Popov [Tue, 9 Feb 2021 11:19:44 +0000 (12:19 +0100)]
Make getElementsByTagNameNS $namespace nullable

According to the DOM specification, this argument is supposed to
be nullable.

4 years agoAdd support for string keys in array unpacking
Nikita Popov [Thu, 7 Jan 2021 09:49:50 +0000 (10:49 +0100)]
Add support for string keys in array unpacking

This adds support for:

    $array1 = ['a' => 1, 'b' => 2];
    $array2 = ['b' => 3, 'c' => 4];
    $array = [...$array1, ...$array2];
    // => ['a' => 1, 'b' => 3, 'c' => 4]

RFC: https://wiki.php.net/rfc/array_unpacking_string_keys

Closes GH-6584.

4 years agoRemove usage of float keys in arrays
George Peter Banyard [Wed, 3 Feb 2021 01:02:13 +0000 (01:02 +0000)]
Remove usage of float keys in arrays

Also make test output not produce trailling whitespaces

Closes GH-6662

4 years agoMerge branch 'PHP-8.0'
Christoph M. Becker [Mon, 8 Feb 2021 22:13:19 +0000 (23:13 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Avoid C4090 level 1 warning

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Christoph M. Becker [Mon, 8 Feb 2021 22:12:49 +0000 (23:12 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Avoid C4090 level 1 warning

4 years agoAvoid C4090 level 1 warning
Christoph M. Becker [Mon, 8 Feb 2021 22:11:37 +0000 (23:11 +0100)]
Avoid C4090 level 1 warning

This breaks the build for PHP 8 by default.

4 years agoGenerate class entries from stubs for another batch of extensions
Máté Kocsis [Fri, 5 Feb 2021 12:46:46 +0000 (13:46 +0100)]
Generate class entries from stubs for another batch of extensions

Closes GH-6669

4 years agoMerge branch 'PHP-8.0'
Christoph M. Becker [Mon, 8 Feb 2021 18:01:42 +0000 (19:01 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix locale dependent parsing of PostgreSQL version number

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Christoph M. Becker [Mon, 8 Feb 2021 18:00:37 +0000 (19:00 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fix locale dependent parsing of PostgreSQL version number

4 years agoFix locale dependent parsing of PostgreSQL version number
Christoph M. Becker [Fri, 5 Feb 2021 11:53:25 +0000 (12:53 +0100)]
Fix locale dependent parsing of PostgreSQL version number

Version numbers are not supposed to be localized, so we must not apply
locale dependent parsing with `atof()`.

Using `php_version_compare()` might even be better.

Closes GH-6668.

4 years agoMerge branch 'PHP-8.0'
Christoph M. Becker [Mon, 8 Feb 2021 17:44:20 +0000 (18:44 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix #80706: mail(): Headers after Bcc headers may be ignored

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Christoph M. Becker [Mon, 8 Feb 2021 17:43:36 +0000 (18:43 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fix #80706: mail(): Headers after Bcc headers may be ignored

4 years agoFix #80706: mail(): Headers after Bcc headers may be ignored
Christoph M. Becker [Thu, 4 Feb 2021 16:43:53 +0000 (17:43 +0100)]
Fix #80706: mail(): Headers after Bcc headers may be ignored

We need to handle the case where a CRLF after a Bcc header is not the
beginning of a folding marker, because in that case the Bcc header was
not the last "thing".

Closes GH-6666.

4 years agorun-tests.php: move JUnit stuff into a class
Max Semenik [Fri, 5 Feb 2021 20:31:31 +0000 (23:31 +0300)]
run-tests.php: move JUnit stuff into a class

This is part one of my work that was announced at
https://externals.io/message/110391

Closes GH-6671.

4 years agoSkip two gettext tests under --repeat
Nikita Popov [Mon, 8 Feb 2021 08:49:33 +0000 (09:49 +0100)]
Skip two gettext tests under --repeat

gettext leaks global state across requests, so don't repeat these
tests. See also GH-6641.

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Sun, 7 Feb 2021 17:02:58 +0000 (18:02 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Restore Laravel test workaround

4 years agoRestore Laravel test workaround
Nikita Popov [Sun, 7 Feb 2021 16:34:01 +0000 (17:34 +0100)]
Restore Laravel test workaround

I accidentally dropped this during a merge, making the Laravel
job fail.

4 years agoMerge remote-tracking branch 'php.net/PHP-8.0'
Tyson Andre [Sat, 6 Feb 2021 19:17:50 +0000 (14:17 -0500)]
Merge remote-tracking branch 'php.net/PHP-8.0'

Conflicts:
ext/zend_test/test.c
ext/zend_test/test.stub.php
ext/zend_test/test_arginfo.h

4 years agoProperly render 2+ namespaces functions in build/gen_stub.php
Tyson Andre [Sat, 6 Feb 2021 19:13:22 +0000 (14:13 -0500)]
Properly render 2+ namespaces functions in build/gen_stub.php

Affects ZEND_NS_FE

Add test cases of the global function

Backported to php 8.0 from GH-6664

4 years agoProperly render 2+ namespaces functions in build/gen_stub.php
Tyson Andre [Wed, 3 Feb 2021 14:57:27 +0000 (09:57 -0500)]
Properly render 2+ namespaces functions in build/gen_stub.php

Affects both INIT_NS_CLASS_ENTRY and ZEND_NS_FE

Add test cases of the global function and namespaced values

Closes GH-6664

4 years agoMerge branch 'PHP-8.0'
Christoph M. Becker [Fri, 5 Feb 2021 13:55:45 +0000 (14:55 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix test expectation for PHP 8.0
  Use ST_Y() instead of the deprecated/removed Y() in test

4 years agoFix test expectation for PHP 8.0
Christoph M. Becker [Fri, 5 Feb 2021 13:55:26 +0000 (14:55 +0100)]
Fix test expectation for PHP 8.0

Since float to string conversion is no longer locale dependent, we have
to expect a dot as decimal separator.

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Christoph M. Becker [Fri, 5 Feb 2021 13:54:25 +0000 (14:54 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Use ST_Y() instead of the deprecated/removed Y() in test

4 years agoUse ST_Y() instead of the deprecated/removed Y() in test
Christoph M. Becker [Fri, 5 Feb 2021 13:53:19 +0000 (14:53 +0100)]
Use ST_Y() instead of the deprecated/removed Y() in test

4 years agoMerge branch 'PHP-8.0'
Christoph M. Becker [Fri, 5 Feb 2021 12:12:30 +0000 (13:12 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix #74779: x() and y() truncating floats to integers

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Christoph M. Becker [Fri, 5 Feb 2021 12:11:22 +0000 (13:11 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fix #74779: x() and y() truncating floats to integers

4 years agoFix #74779: x() and y() truncating floats to integers
Christoph M. Becker [Thu, 4 Feb 2021 13:43:17 +0000 (14:43 +0100)]
Fix #74779: x() and y() truncating floats to integers

We must not use the locale dependent `atof()`, but instead use the
(hopefully) locale independent `zend_strtod()`, when converting string
representations of floating point numbers which are sent by the server.

Closes GH-6665.

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Thu, 4 Feb 2021 16:07:39 +0000 (17:07 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Try SIGTERM before SIGKILL in opcache restart

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Nikita Popov [Thu, 4 Feb 2021 16:07:30 +0000 (17:07 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Try SIGTERM before SIGKILL in opcache restart

4 years agoTry SIGTERM before SIGKILL in opcache restart
Nikita Popov [Mon, 7 Dec 2020 11:57:30 +0000 (12:57 +0100)]
Try SIGTERM before SIGKILL in opcache restart

SIGTERM is subject to HANDLE_BLOCK_INTERRUPTIONS(), which will
allow code to exit critical sections before it gets terminated.

Closes GH-6493.

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Thu, 4 Feb 2021 14:24:20 +0000 (15:24 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix CLI server worker support

4 years agoFix CLI server worker support
Nikita Popov [Thu, 4 Feb 2021 14:18:45 +0000 (15:18 +0100)]
Fix CLI server worker support

If we create separate listening sockets in each worker using
SO_REUSEADDR, then an incoming connection may be load-balanced
to a process that is already busy, either due to a long-running
request, or because it is a recursive request (in which case we
would deadlock).

Instead, only create one listening socket, and only create worker
forks afterwards. This way the incoming request will be served
by one of the workers that is currently listening for an incoming
connection.

4 years ago[ci skip] Merge branch 'PHP-8.0'
Christoph M. Becker [Wed, 3 Feb 2021 11:45:47 +0000 (12:45 +0100)]
[ci skip] Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix newly introduced compiler warning

4 years ago[ci skip] Merge branch 'PHP-7.4' into PHP-8.0
Christoph M. Becker [Wed, 3 Feb 2021 11:44:52 +0000 (12:44 +0100)]
[ci skip] Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fix newly introduced compiler warning

4 years ago[ci skip] Merge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Wed, 3 Feb 2021 11:43:15 +0000 (12:43 +0100)]
[ci skip] Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix newly introduced compiler warning

4 years agoFix newly introduced compiler warning
Nikita Popov [Mon, 1 Feb 2021 08:46:17 +0000 (09:46 +0100)]
Fix newly introduced compiler warning

(cherry picked from commit ab8177de2c89672e63a7a1ccef4df8f7bf34fbd2)

4 years agoAdd IL compat flag to Windows builds
David Gebler [Tue, 2 Feb 2021 15:44:21 +0000 (16:44 +0100)]
Add IL compat flag to Windows builds

Enabled by default; use `--disable-vs-link-compat` to disable.

Closes GH-6658.

4 years agoMerge branch 'PHP-8.0'
Christoph M. Becker [Wed, 3 Feb 2021 10:25:02 +0000 (11:25 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix #53467: Phar cannot compress large archives

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Christoph M. Becker [Wed, 3 Feb 2021 10:23:59 +0000 (11:23 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fix #53467: Phar cannot compress large archives

4 years agoFix #53467: Phar cannot compress large archives
Christoph M. Becker [Tue, 26 Jan 2021 16:46:32 +0000 (17:46 +0100)]
Fix #53467: Phar cannot compress large archives

When Phars are flushed, a new temporary file is created for each entry
which should be compressed, and the `compressed_filesize` is retrieved.
Afterwards, the Phar manifest is written, and only after that the files
are copied to the actual Phar.  So for each such entry there is an open
temp file, what easily exceeds the limit.

Therefore, we use a single temporary file for all entries, and store
the start offset in the otherwise unused `header_offset` member.  We
ensure that the `cfp` members are properly set to NULL even if flushing
fails, to avoid use after free scenarios.

This solution is based on a suggestion by @lserni[1].

Closes GH-6643.

[1] <https://github.com/box-project/box2/issues/80#issuecomment-77147371>

4 years agoGenerate class entries for a few extensions
Máté Kocsis [Wed, 3 Feb 2021 08:03:18 +0000 (09:03 +0100)]
Generate class entries for a few extensions

Relates to GH-6644

4 years ago[ci-skip] Merge branch 'PHP-8.0'
Benjamin Eberlei [Tue, 2 Feb 2021 19:30:01 +0000 (20:30 +0100)]
[ci-skip] Merge branch 'PHP-8.0'

4 years agoFix bug #80600 DOMChildNode::remove does not work on DOMCharacterData.
Benjamin Eberlei [Mon, 1 Feb 2021 20:11:12 +0000 (21:11 +0100)]
Fix bug #80600 DOMChildNode::remove does not work on DOMCharacterData.

Closes GH-6660

4 years ago[ci skip] Merge branch 'PHP-8.0'
Christoph M. Becker [Tue, 2 Feb 2021 16:11:19 +0000 (17:11 +0100)]
[ci skip] Merge branch 'PHP-8.0'

* PHP-8.0:
  7.3.28 is next

4 years ago[ci skip] Merge branch 'PHP-7.4' into PHP-8.0
Christoph M. Becker [Tue, 2 Feb 2021 16:08:00 +0000 (17:08 +0100)]
[ci skip] Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  7.3.28 is next

4 years ago[ci skip] Merge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Tue, 2 Feb 2021 16:03:05 +0000 (17:03 +0100)]
[ci skip] Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  7.3.28 is next

4 years ago7.3.28 is next
Christoph M. Becker [Tue, 2 Feb 2021 16:01:55 +0000 (17:01 +0100)]
7.3.28 is next

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Tue, 2 Feb 2021 15:47:03 +0000 (16:47 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Update year to 2021

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Nikita Popov [Tue, 2 Feb 2021 15:46:52 +0000 (16:46 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Update year to 2021

4 years agoUpdate year to 2021
Peter Kokot [Sun, 24 Jan 2021 11:23:20 +0000 (12:23 +0100)]
Update year to 2021

Closes GH-6636.

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Tue, 2 Feb 2021 15:44:12 +0000 (16:44 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Remove unnecessary cast in snmp_set_oid_output_format

4 years agoRemove unnecessary cast in snmp_set_oid_output_format
Nikita Popov [Tue, 2 Feb 2021 15:43:43 +0000 (16:43 +0100)]
Remove unnecessary cast in snmp_set_oid_output_format

This cast isn't needed, and could result in the ValueError being
skipped due to truncation.

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Tue, 2 Feb 2021 09:32:25 +0000 (10:32 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Add missing derefs in CurlFile

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Nikita Popov [Tue, 2 Feb 2021 09:32:11 +0000 (10:32 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Add missing derefs in CurlFile

4 years agoAdd missing derefs in CurlFile
Nikita Popov [Tue, 2 Feb 2021 09:31:16 +0000 (10:31 +0100)]
Add missing derefs in CurlFile

As pointed out on GH-6456.

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Tue, 2 Feb 2021 09:07:19 +0000 (10:07 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix persistent leak on load_wsdl_ex failure

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Nikita Popov [Tue, 2 Feb 2021 09:07:04 +0000 (10:07 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fix persistent leak on load_wsdl_ex failure

4 years agoFix persistent leak on load_wsdl_ex failure
Nikita Popov [Tue, 2 Feb 2021 09:05:35 +0000 (10:05 +0100)]
Fix persistent leak on load_wsdl_ex failure

Move the load_wsdl_ex call into the zend_try that destroys the
docs hash table. The wsdl will be inserted into docs early on,
and will thus be released on subsequent bailout.

4 years agoMerge branch 'PHP-8.0'
Christoph M. Becker [Mon, 1 Feb 2021 12:44:42 +0000 (13:44 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Revert "Updated to version 2021.1 (2021a)"

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Christoph M. Becker [Mon, 1 Feb 2021 12:43:57 +0000 (13:43 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Revert "Updated to version 2021.1 (2021a)"

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Mon, 1 Feb 2021 12:42:43 +0000 (13:42 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Revert "Updated to version 2021.1 (2021a)"

4 years agoRevert "Updated to version 2021.1 (2021a)"
Christoph M. Becker [Mon, 1 Feb 2021 12:41:32 +0000 (13:41 +0100)]
Revert "Updated to version 2021.1 (2021a)"

This reverts commit 491488d21707062fa8e9b9187db3585fb0d347da, since
PHP-7.3 is in security mode, and this does not look security related.

4 years agoMerge branch 'PHP-8.0'
Christoph M. Becker [Mon, 1 Feb 2021 12:01:27 +0000 (13:01 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix #80654: file_get_contents() maxlen fails above (2**31)-1 bytes

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Christoph M. Becker [Mon, 1 Feb 2021 11:59:22 +0000 (12:59 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fix #80654: file_get_contents() maxlen fails above (2**31)-1 bytes

4 years agoFix #80654: file_get_contents() maxlen fails above (2**31)-1 bytes
Christoph M. Becker [Thu, 28 Jan 2021 16:00:16 +0000 (17:00 +0100)]
Fix #80654: file_get_contents() maxlen fails above (2**31)-1 bytes

We remove the arbitrary restriction to `INT_MAX`; it is superfluous on
32bit systems where `ZEND_LONG_MAX == INT_MAX` anyway, and not useful
on 64bit systems, where larger files should be readable, if the
`memory_limit` is large enough.

Closes GH-6648.

4 years agoDocument .dtor_obj and .free_obj
Levi Morrison [Mon, 1 Feb 2021 05:32:24 +0000 (22:32 -0700)]
Document .dtor_obj and .free_obj

Closes GH-6656.

Co-authored-by: Nikita Popov <nikic@php.net>
4 years agoFix environment variable not work in run-tests.php
twosee [Mon, 1 Feb 2021 04:56:59 +0000 (12:56 +0800)]
Fix environment variable not work in run-tests.php

Closes GH-6657.

4 years agoFix ubsan warning on macos
David CARLIER [Sat, 30 Jan 2021 09:47:52 +0000 (09:47 +0000)]
Fix ubsan warning on macos

Closes GH-6652.

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Mon, 1 Feb 2021 09:24:18 +0000 (10:24 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  XFAIL observer_error_05.phpt test