]> granicus.if.org Git - php/log
php
4 years agoPersist class name before methods, because it may be used insted of "self"
Dmitry Stogov [Mon, 15 Feb 2021 09:33:53 +0000 (12:33 +0300)]
Persist class name before methods, because it may be used insted of "self"

4 years agoCI: add --depth 1 to git clone for speed
Max Semenik [Sat, 13 Feb 2021 17:22:26 +0000 (20:22 +0300)]
CI: add --depth 1 to git clone for speed

Closes GH-6690.

4 years agoUse VM_MAKE_TAG for macos memory tag
David CARLIER [Sat, 13 Feb 2021 07:58:48 +0000 (07:58 +0000)]
Use VM_MAKE_TAG for macos memory tag

In case Apple changes the meaning of the macro in the future.

Closes GH-6687.

4 years agoRemove stray mentions of mbstring.func_overload
Max Semenik [Sat, 13 Feb 2021 09:24:54 +0000 (12:24 +0300)]
Remove stray mentions of mbstring.func_overload

This feature has been completely removed.

Closes GH-6688.

4 years agoFix failures due to new deprecations
Christopher Jones [Mon, 15 Feb 2021 01:15:44 +0000 (12:15 +1100)]
Fix failures due to new deprecations

4 years agoGenerate class entries from stubs for phar, posix, pspell, readline, reflection,...
Máté Kocsis [Sun, 14 Feb 2021 14:21:24 +0000 (15:21 +0100)]
Generate class entries from stubs for phar, posix, pspell, readline, reflection, session, shmop

Closes GH-6692

4 years agoGenerate class entries from stubs for oci8, odbc, openssl, pcntl, pdo, pgsql
Máté Kocsis [Sun, 14 Feb 2021 11:00:03 +0000 (12:00 +0100)]
Generate class entries from stubs for oci8, odbc, openssl, pcntl, pdo, pgsql

Closes GH-6691

4 years agoGenerate zend class entries based on stubs
Máté Kocsis [Fri, 12 Feb 2021 22:33:09 +0000 (23:33 +0100)]
Generate zend class entries based on stubs

Closes GH-6685

4 years agoEnable class entry generation for sapi extensions
Máté Kocsis [Sun, 14 Feb 2021 11:03:48 +0000 (12:03 +0100)]
Enable class entry generation for sapi extensions

4 years agoOptimize Traversable unpacking in zend_vm_def.h
Tyson Andre [Sat, 13 Feb 2021 00:42:03 +0000 (19:42 -0500)]
Optimize Traversable unpacking in zend_vm_def.h

The C compiler sees that a dynamic function is being called, so it cannot infer
that iter->funcs has not changed.

This results in more assembly instructions and slightly more time to execute that code
path.

Unpacking traversables to arrays(`ZEND_ADD_ARRAY_UNPACK`),
starting foreach loops (`ZEND_FE_FETCH*`), etc. are affected.

```
<?php
/*
 * Before: 1.576 seconds
 * After:  1.474 seconds
 */
function example() {
    $start = hrtime(true);
    $it = new SplFixedArray(1000);
    $total = 0;
    for ($i = 0; $i < 100000; $i++) {
        $total += count([...$it]);
    }
    $end = hrtime(true);
    printf("Elapsed: %.6f\n", ($end - $start) / 1_000_000_000);
}
example();
```

4 years agoRevert "Implement fetching TLS TCB offset on MacOS"
Nikita Popov [Fri, 12 Feb 2021 14:16:05 +0000 (15:16 +0100)]
Revert "Implement fetching TLS TCB offset on MacOS"

This reverts commit 1106ff9a0e420e043c2e56c8ca00db85f1b85ee6.

Looks like this sauses segfaults on MacOs ZTS with JIT.

4 years agoDeprecate passing null to non-nullable arg of internal function
Nikita Popov [Mon, 30 Nov 2020 15:45:48 +0000 (16:45 +0100)]
Deprecate passing null to non-nullable arg of internal function

This deprecates passing null to non-nullable scale arguments of
internal functions, with the eventual goal of making the behavior
consistent with userland functions, where null is never accepted
for non-nullable arguments.

This change is expected to cause quite a lot of fallout. In most
cases, calling code should be adjusted to avoid passing null. In
some cases, PHP should be adjusted to make some function arguments
nullable. I have already fixed a number of functions before landing
this, but feel free to file a bug if you encounter a function that
doesn't accept null, but probably should. (The rule of thumb for
this to be applicable is that the function must have special behavior
for 0 or "", which is distinct from the natural behavior of the
parameter.)

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

Closes GH-6475.

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

* PHP-8.0:
  Fixed bug #80718

4 years agoFixed bug #80718
Nikita Popov [Thu, 11 Feb 2021 15:49:39 +0000 (16:49 +0100)]
Fixed bug #80718

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

* PHP-8.0:
  Fixed bug #80719

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Nikita Popov [Thu, 11 Feb 2021 15:13:56 +0000 (16:13 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fixed bug #80719

4 years agoFixed bug #80719
Nikita Popov [Thu, 11 Feb 2021 15:12:06 +0000 (16:12 +0100)]
Fixed bug #80719

4 years agoImplement fetching TLS TCB offset on MacOS
David Carlier [Mon, 1 Feb 2021 17:26:39 +0000 (17:26 +0000)]
Implement fetching TLS TCB offset on MacOS

Tested with php-cgi and wordpress and 1255 for jit settings.

Closes GH-6659.

4 years agoAllow all scalar types in ini_set()
Nikita Popov [Thu, 11 Feb 2021 09:42:55 +0000 (10:42 +0100)]
Allow all scalar types in ini_set()

This changes ini_set() to accept all scalar types
(string|int|float|bool|null) for the new value. The idea here is
that while the INI system ultimately works with strings, its value
interpretation is designed to be consistent with PHP's casting rules,
e.g. "1" and "" are interpreted as boolean true and false respectively.

I personally believe that writing ini_set('precision', 10) makes more
sense than ini_set('precision', '10'), and find strict_types to be
unnecessarily pedantic here.

Closes GH-6680.

4 years agoAvoid useless SHM data duplication
Dmitry Stogov [Thu, 11 Feb 2021 13:51:08 +0000 (16:51 +0300)]
Avoid useless SHM data duplication

4 years agoFix typo in warnings_during_sccp
Tyson Andre [Thu, 11 Feb 2021 13:23:01 +0000 (08:23 -0500)]
Fix typo in warnings_during_sccp

Should be capture_warnings_during_sccp

Related to 4c088c5da7fb96380a4cfc420d272075b40b6141

4 years agoSort some decls in spl_iterators.h
Levi Morrison [Thu, 11 Feb 2021 12:11:11 +0000 (05:11 -0700)]
Sort some decls in spl_iterators.h

There are enough of them that sorting makes it a bit nicer.

4 years agoHandle warnings during sccp function evaluation
Nikita Popov [Thu, 11 Feb 2021 11:31:36 +0000 (12:31 +0100)]
Handle warnings during sccp function evaluation

Some upcoming changes like https://wiki.php.net/rfc/deprecate_null_to_scalar_internal_arg
will make it somewhat inconvenient to determine whether a given
function invocation will generate a diagnostic. Rather than trying
to exclude this in advance, call the function with diagnostics
suppressed, and check whether anything was thrown.

This adds a new EG flag that is kept specific to the SCCP use-case.
This does not use the error_cb hook as it is a (non-TLS) global,
and doesn't fully suppress error handling besides.

Test this by removing the in advance checks for implode and array_flip.

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

* PHP-8.0:
  Update func info after password_get_info() change

4 years agoUpdate func info after password_get_info() change
Nikita Popov [Thu, 11 Feb 2021 10:44:14 +0000 (11:44 +0100)]
Update func info after password_get_info() change

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

* PHP-8.0:
  Don't return null from password_get_info()

4 years agoDon't return null from password_get_info()
Nikita Popov [Thu, 11 Feb 2021 09:21:31 +0000 (10:21 +0100)]
Don't return null from password_get_info()

The get_info() handler should never fail, but even if it does,
we should still return a proper info array -- it doesn't make
sense that a completely incorrect hash returns an info array,
but a hash that is recognized but for which the options can't
be extracted would return null.

4 years agorun-tests: fix JUnit counts
Max Semenik [Wed, 10 Feb 2021 22:56:59 +0000 (01:56 +0300)]
run-tests: fix JUnit counts

In 19680f886f, I forgot about my own TODO. At least, now I understand what
this line was about :P

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Thu, 11 Feb 2021 08:42:05 +0000 (09:42 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Don't throw additional Error in require_once if exception already thrown

4 years agoDon't throw additional Error in require_once if exception already thrown
Nikita Popov [Thu, 11 Feb 2021 08:40:19 +0000 (09:40 +0100)]
Don't throw additional Error in require_once if exception already thrown

As pointed out in comments on bug #66216.

4 years agoLink unbound simple classes (without parent/intefaces/traits) in first place.
Dmitry Stogov [Wed, 10 Feb 2021 20:57:50 +0000 (23:57 +0300)]
Link unbound simple classes (without parent/intefaces/traits) in first place.

4 years agoUnserialize op_array->scope before passing to zend_file_cache_unserialize_type().
Dmitry Stogov [Wed, 10 Feb 2021 20:55:59 +0000 (23:55 +0300)]
Unserialize op_array->scope before passing to zend_file_cache_unserialize_type().
Don't use scope of closures.

4 years agoUse zend_type.ce_cache__ptr for caching class resulution during argument/result type...
Dmitry Stogov [Wed, 10 Feb 2021 15:00:00 +0000 (18:00 +0300)]
Use zend_type.ce_cache__ptr for caching class resulution during argument/result type checks

4 years agoFixed map_ptr slot sharing for trait/self
Dmitry Stogov [Wed, 10 Feb 2021 14:59:11 +0000 (17:59 +0300)]
Fixed map_ptr slot sharing for trait/self

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

* PHP-8.0:
  Make mysqli_ssl_set() arguments nullable

4 years agoMake mysqli_ssl_set() arguments nullable
Nikita Popov [Wed, 10 Feb 2021 14:31:27 +0000 (15:31 +0100)]
Make mysqli_ssl_set() arguments nullable

This function internally converts zero length arguments to NULL
argument -- but we should also accept them in the first place.

Null arguments being accepted was actually documented, before
bug #78399 adjusted the docs to match current behavior.

4 years agoReuse single map_ptr slot for indentical class names
Dmitry Stogov [Wed, 10 Feb 2021 12:22:09 +0000 (15:22 +0300)]
Reuse single map_ptr slot for indentical class names

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.