]> granicus.if.org Git - php/log
php
4 years agoMerge branch 'PHP-8.0'
Sara Golemon [Wed, 17 Feb 2021 15:25:37 +0000 (15:25 +0000)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Prep for 8.0.4

4 years agoPrep for 8.0.4
Sara Golemon [Wed, 17 Feb 2021 15:24:36 +0000 (15:24 +0000)]
Prep for 8.0.4

4 years agounserialize() optimization. Omit class name validation before hash lookup, and perfor...
Dmitry Stogov [Wed, 17 Feb 2021 10:30:52 +0000 (13:30 +0300)]
unserialize() optimization. Omit class name validation before hash lookup, and perform it only before autoloading.

4 years agoMerge branch 'PHP-8.0'
Dmitry Stogov [Wed, 17 Feb 2021 08:51:50 +0000 (11:51 +0300)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fixed bug #80745 (JIT produces Assert failure and UNKNOWN:0 var_dumps in code involving bitshifts)

4 years agoFixed bug #80745 (JIT produces Assert failure and UNKNOWN:0 var_dumps in code involvi...
Dmitry Stogov [Wed, 17 Feb 2021 08:51:13 +0000 (11:51 +0300)]
Fixed bug #80745 (JIT produces Assert failure and UNKNOWN:0 var_dumps in code involving bitshifts)

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Wed, 17 Feb 2021 08:45:31 +0000 (09:45 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Remove generated zend_jit_x86.c on `make clean`

4 years agoRemove generated zend_jit_x86.c on `make clean`
Dylan T [Tue, 16 Feb 2021 18:40:26 +0000 (18:40 +0000)]
Remove generated zend_jit_x86.c on `make clean`

Not removing this causes build failure when reconfiguring and rebuilding after a `make clean`, e.g. enabling/disabling ZTS.

This makes https://bugs.php.net/bug.php?id=80561 more bearable. Ideally it would be rebuilt automatically on configuration change if necessary, but I have no idea how to implement this.

Closes GH-6702.

4 years agoMerge branch 'PHP-8.0'
Dmitry Stogov [Tue, 16 Feb 2021 17:02:48 +0000 (20:02 +0300)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fixed bug #80742 (Opcache JIT makes some boolean logic unexpectedly be true)

4 years agoFixed bug #80742 (Opcache JIT makes some boolean logic unexpectedly be true)
Dmitry Stogov [Tue, 16 Feb 2021 17:02:12 +0000 (20:02 +0300)]
Fixed bug #80742 (Opcache JIT makes some boolean logic unexpectedly be true)

4 years agoAdd support for generating properties with union type of multiple classes
Máté Kocsis [Tue, 16 Feb 2021 11:26:31 +0000 (12:26 +0100)]
Add support for generating properties with union type of multiple classes

Closes GH-6701

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

* PHP-8.0:
  Handle incomplete result set metadata more gracefully

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

* PHP-7.4:
  Handle incomplete result set metadata more gracefully

4 years agoHandle incomplete result set metadata more gracefully
Nikita Popov [Tue, 16 Feb 2021 14:26:31 +0000 (15:26 +0100)]
Handle incomplete result set metadata more gracefully

Rather than segfaulting because sname is missing lateron, report
a FAIL here. As this indicates a server bug, the errors is reported
as an out of band warning, rather than a client error.

This fixes the PHP side of bug #80713.

4 years agoGenerate class entries from stubs for ldap, libxml, mbstring and mysqli
Máté Kocsis [Tue, 9 Feb 2021 22:21:26 +0000 (23:21 +0100)]
Generate class entries from stubs for ldap, libxml, mbstring and mysqli

Closes GH-6684

4 years agoFix unused variable warning
Nikita Popov [Tue, 16 Feb 2021 13:24:58 +0000 (14:24 +0100)]
Fix unused variable warning

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

* PHP-8.0:
  Mark resource-like objects as non-comparable

4 years agoMark resource-like objects as non-comparable
Nikita Popov [Tue, 16 Feb 2021 13:20:45 +0000 (14:20 +0100)]
Mark resource-like objects as non-comparable

As these hold on to some internal resource, there can't be two
"equal" objects with different identity. Make sure the lack of
public properties doesn't result in these being treated as always
equal.

4 years agoImproved unserialize() performance. Checks for object propery "visibility change...
Dmitry Stogov [Tue, 16 Feb 2021 12:27:58 +0000 (15:27 +0300)]
Improved unserialize() performance. Checks for object propery "visibility change" were moved, to be performed only if name/visibility had been really changed.

4 years agoImprove class entry generation
Máté Kocsis [Mon, 15 Feb 2021 21:14:36 +0000 (22:14 +0100)]
Improve class entry generation

Related to GH-6701

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

* PHP-8.0:
  Fixed bug #80723

4 years agoFixed bug #80723
Nikita Popov [Tue, 16 Feb 2021 11:32:43 +0000 (12:32 +0100)]
Fixed bug #80723

This fixes the issue just for the Socket class. Presumably we'll
want to do the same for other "resource" objects.

4 years agoMerge branch 'PHP-8.0'
Derick Rethans [Tue, 16 Feb 2021 11:31:53 +0000 (11:31 +0000)]
Merge branch 'PHP-8.0'

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Derick Rethans [Tue, 16 Feb 2021 11:31:43 +0000 (11:31 +0000)]
Merge branch 'PHP-7.4' into PHP-8.0

4 years agoFixed dates
Derick Rethans [Tue, 16 Feb 2021 11:31:34 +0000 (11:31 +0000)]
Fixed dates

4 years agoMerge branch 'PHP-8.0'
Derick Rethans [Tue, 16 Feb 2021 11:27:24 +0000 (11:27 +0000)]
Merge branch 'PHP-8.0'

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Derick Rethans [Tue, 16 Feb 2021 11:27:17 +0000 (11:27 +0000)]
Merge branch 'PHP-7.4' into PHP-8.0

4 years agoPHP-7.4 is now 7.4.17-dev
Derick Rethans [Tue, 16 Feb 2021 11:26:47 +0000 (11:26 +0000)]
PHP-7.4 is now 7.4.17-dev

4 years agoMicrooptimization of STRLEN and IN_ARRAY opcodes (based on https://github.com/php...
Dmitry Stogov [Tue, 16 Feb 2021 11:11:47 +0000 (14:11 +0300)]
Microoptimization of STRLEN and IN_ARRAY opcodes (based on https://github.com/php/php-src/pull/4981)

4 years agoFix quadratic slowdown under asan in timelib
Nikita Popov [Tue, 16 Feb 2021 10:54:34 +0000 (11:54 +0100)]
Fix quadratic slowdown under asan in timelib

This is a hotfix for https://github.com/derickr/timelib/pull/94
until the issue is resolved upstream.

4 years agoAdd dependency tracking for header files
Florian Sowade [Sun, 14 Feb 2021 19:07:54 +0000 (20:07 +0100)]
Add dependency tracking for header files

This ensures all .c files which include a header file directly or
indirectly are rebuilt whenever the header file is changed.

Closes GH-6693.

4 years agocURL: make possible to send file from buffer string
Alexander Moskalev [Thu, 26 Nov 2020 07:30:02 +0000 (10:30 +0300)]
cURL: make possible to send file from buffer string

Add CURLStringFile class which works similarly to CURLFile, but
uploads a file from a string rather than a file. This avoids the
need to create a temporary file, or use of a data:// stream.

Basic usage:

    $file = new CURLStringFile($data, 'filename.txt', 'text/plain');
    curl_setopt($curl, CURLOPT_POSTFIELDS, ['file' => $file]);

Closes GH-6456.

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

* PHP-8.0:
  Increase timeout on asan job

4 years agoIncrease timeout on asan job
Nikita Popov [Tue, 16 Feb 2021 09:15:08 +0000 (10:15 +0100)]
Increase timeout on asan job

Regularly runs against the 5:10 hour limit on master. Increase it
to 6:00 hours.

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

* PHP-8.0:
  Suppress OpenSSL error on missing optional config

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

* PHP-7.4:
  Suppress OpenSSL error on missing optional config

4 years agoSuppress OpenSSL error on missing optional config
Nikita Popov [Mon, 15 Feb 2021 14:54:49 +0000 (15:54 +0100)]
Suppress OpenSSL error on missing optional config

openssl_pkey_new() fetches various options from the config file --
most of these are optional, and not specifying them is not an error
condition from the perspective of the user. Unfortunately, the
CONF_get_string() API pushes an error when accessing a key that
doesn't exist (_CONF_get_string does not, but that is presumably a
private API). This commit adds a helper php_openssl_conf_get_string()
that automatically clears the error in this case. I've found that
OpenSSL occasionally does the same thing internally:
https://github.com/openssl/openssl/blob/22040fb790c854cefb04bed98ed38ea6357daf83/apps/req.c#L515-L517

Closes GH-6699.

4 years agoDelref only after successful allocation
Nikita Popov [Tue, 16 Feb 2021 08:55:02 +0000 (09:55 +0100)]
Delref only after successful allocation

Otherwise we may have inconsistent refcounts after OOM.

I expect this problem is much more prevalent, but this at least
fixes some string/array separation cases.

Fixes oss-fuzz #30999.

4 years agoMerge branch 'PHP-8.0'
Christoph M. Becker [Mon, 15 Feb 2021 23:30:03 +0000 (00:30 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Adapt test case for libcurl 7.75.0+

4 years agoAdapt test case for libcurl 7.75.0+
Christoph M. Becker [Mon, 15 Feb 2021 23:17:13 +0000 (00:17 +0100)]
Adapt test case for libcurl 7.75.0+

libcurl 7.75.0 finally adds support for `gophers://`, i.e. gopher over
TLS.  The protocol is neither standardized, nor is the protocol
registered with IANA, but well, it is there and the test case should
cater to that.

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

* PHP-8.0:
  Fixed bug #80747

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Nikita Popov [Mon, 15 Feb 2021 14:34:11 +0000 (15:34 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fixed bug #80747

4 years agoFixed bug #80747
Nikita Popov [Mon, 15 Feb 2021 14:33:42 +0000 (15:33 +0100)]
Fixed bug #80747

If RSA key generation fails, actually report that failure.

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Mon, 15 Feb 2021 13:59:07 +0000 (14:59 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix symtable cache being used while cleaning symtable

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Nikita Popov [Mon, 15 Feb 2021 13:58:59 +0000 (14:58 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fix symtable cache being used while cleaning symtable

4 years agoFix symtable cache being used while cleaning symtable
Nikita Popov [Mon, 15 Feb 2021 13:52:38 +0000 (14:52 +0100)]
Fix symtable cache being used while cleaning symtable

We need to first clean the symtable and then check whether a cache
slot is available for it. Otherwise, it may happen that a destructor
runs while cleaning the table and uses up all the remaining slots
in the cache.

This is particularly insidious because once we overflow the cache,
the first pointer we modify is symtable_cache_ptr, making it hard
to understand what happened after the fact.

Fixes oss-fuzz #30815.

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

* PHP-8.0:
  Fix assertion failure in cufa optimization with named args

4 years agoFix assertion failure in cufa optimization with named args
Nikita Popov [Mon, 15 Feb 2021 11:42:48 +0000 (12:42 +0100)]
Fix assertion failure in cufa optimization with named args

Fixes oss-fuzz#30764.

4 years agoUse typed proprety for Transliterator::$id
Nikita Popov [Mon, 15 Feb 2021 11:25:55 +0000 (12:25 +0100)]
Use typed proprety for Transliterator::$id

This is a read-only property for which Transliterator internally
assigns a string value.

Also clean up the code handling this property a bit.

4 years agoUsed typed properties for reflection $name and $class
Nikita Popov [Mon, 15 Feb 2021 11:08:15 +0000 (12:08 +0100)]
Used typed properties for reflection $name and $class

These are read-only properties, and Reflection makes sure to assign
only strings.

4 years agoGenerate class entries for snmp, soap, sockets, sodium, sqlite3, sysv*, tidy
Máté Kocsis [Mon, 15 Feb 2021 09:00:46 +0000 (10:00 +0100)]
Generate class entries for snmp, soap, sockets, sodium, sqlite3, sysv*, tidy

Closes GH-6696

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

* PHP-8.0:
  Fix #78680: mysqlnd pam plugin missing terminating null

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

* PHP-7.4:
  Fix #78680: mysqlnd pam plugin missing terminating null

4 years agoFix #78680: mysqlnd pam plugin missing terminating null
Daniel Black [Fri, 5 Feb 2021 05:54:08 +0000 (16:54 +1100)]
Fix #78680: mysqlnd pam plugin missing terminating null

The PAM service requires the terminating null to be part
of the communication.

Tested with MariaDB-10.4(pam) and Percona Server 5.7.32(auth_pam_compat).

Also changed MySQL Enterprise test to the server side plugin, authentication_pam
as opposed to the client plugin mysql_clear_password.

Add additional check for pamtest user and pam service file as
all are required for the test.

More importantly, test result should actually succeed.

Thanks Geoff Montee for bug report.

Closes GH-78680.

4 years agoAvoid repeatedly calling strlen in FPM setproctitle implementation
David Carlier [Sat, 13 Feb 2021 10:26:43 +0000 (10:26 +0000)]
Avoid repeatedly calling strlen in FPM setproctitle implementation

Closes GH-6689.

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

* PHP-8.0:
  Fix leak when breaking out of FilesystemIterator
  Fixed bug #80600

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Nikita Popov [Mon, 15 Feb 2021 09:38:21 +0000 (10:38 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fix leak when breaking out of FilesystemIterator

4 years agoFix leak when breaking out of FilesystemIterator
Nikita Popov [Mon, 15 Feb 2021 09:36:48 +0000 (10:36 +0100)]
Fix leak when breaking out of FilesystemIterator

We need to always destroy current, not just when iter.data is not
set.

Take this opportunity to clean up the iterator destructor code a
bit, to remove redundant checks and incorrect comments.

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 agoFixed bug #80600
Benjamin Eberlei [Fri, 12 Feb 2021 16:16:48 +0000 (17:16 +0100)]
Fixed bug #80600

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