]> granicus.if.org Git - php/log
php
5 years agozend_parse_parameters_throw() is obsolete
Christoph M. Becker [Fri, 1 Nov 2019 12:19:52 +0000 (13:19 +0100)]
zend_parse_parameters_throw() is obsolete

Since `zend_parse_parameters()` throws now, there is no reason to
explicitly call `zend_parse_parameters_throw()` anymore, and since both
have actually the same implementation, we redefine the latter as macro.

5 years agoAdd missing ZPP checks
Máté Kocsis [Thu, 31 Oct 2019 09:20:41 +0000 (10:20 +0100)]
Add missing ZPP checks

Closes GH-4878.

5 years agoFinish OpenSSL arginfo stubs
Christoph M. Becker [Fri, 1 Nov 2019 14:19:57 +0000 (15:19 +0100)]
Finish OpenSSL arginfo stubs

5 years agoMerge branch 'PHP-7.4'
Fabien Villepinte [Fri, 1 Nov 2019 11:38:32 +0000 (12:38 +0100)]
Merge branch 'PHP-7.4'

5 years agoFix conflicts between tests with obscure filenames
Fabien Villepinte [Fri, 1 Nov 2019 11:33:36 +0000 (12:33 +0100)]
Fix conflicts between tests with obscure filenames

For non-windows tests

5 years agoMerge branch 'PHP-7.4'
Fabien Villepinte [Fri, 1 Nov 2019 11:27:04 +0000 (12:27 +0100)]
Merge branch 'PHP-7.4'

5 years agoFix conflicts between tests with obscure filenames
Fabien Villepinte [Fri, 1 Nov 2019 11:24:38 +0000 (12:24 +0100)]
Fix conflicts between tests with obscure filenames

5 years agopdo_oci: Add support for setting and getting the oracle OCI 18c call timeout value.
Cameron Porter [Fri, 25 Oct 2019 06:32:12 +0000 (08:32 +0200)]
pdo_oci: Add support for setting and getting the oracle OCI 18c call timeout value.

5 years agoDon't skip RECV instuctions when function uses type hints
Dmitry Stogov [Fri, 1 Nov 2019 06:33:46 +0000 (09:33 +0300)]
Don't skip RECV instuctions when function uses type hints

5 years agoMerge branch 'PHP-7.4'
Christoph M. Becker [Thu, 31 Oct 2019 15:10:18 +0000 (16:10 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Fix test cases for libxml2 2.9.10

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Thu, 31 Oct 2019 15:09:38 +0000 (16:09 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix test cases for libxml2 2.9.10

5 years agoMerge branch 'PHP-7.2' into PHP-7.3
Christoph M. Becker [Thu, 31 Oct 2019 15:08:38 +0000 (16:08 +0100)]
Merge branch 'PHP-7.2' into PHP-7.3

* PHP-7.2:
  Fix test cases for libxml2 2.9.10

5 years agoFix test cases for libxml2 2.9.10
Christoph M. Becker [Thu, 31 Oct 2019 15:02:05 +0000 (16:02 +0100)]
Fix test cases for libxml2 2.9.10

Since the error reporting has been slightly changed, we have to adapt
the two affected test cases.

5 years agoAdd stubs for WeakReference
Nikita Popov [Thu, 31 Oct 2019 11:17:04 +0000 (12:17 +0100)]
Add stubs for WeakReference

5 years agoMerge branch 'PHP-7.4'
Nikita Popov [Thu, 31 Oct 2019 10:34:15 +0000 (11:34 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Remove configure checks for supported instruction sets

5 years agoRemove configure checks for supported instruction sets
Nikita Popov [Thu, 31 Oct 2019 10:27:53 +0000 (11:27 +0100)]
Remove configure checks for supported instruction sets

These were checking whether the instruction set is supported by
the host CPU, however they were only used to condition on whether
this instruction set is targeted at all. It would still use dynamic
dispatch (e.g. based on ifunc resolvers) to select the actual
implementation. Whether the target is guaranteed to support the
instruction set without dispatch is determined based on pre-defined
macros like __SSE2__.

This removes the configure-time builtin cpu checks to remove
confusion. Additionally this allows targeting an architecture that
is newer than the host architecture.

5 years agoMerge branch 'PHP-7.4'
Nikita Popov [Thu, 31 Oct 2019 08:37:27 +0000 (09:37 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Fix bug #77930: Remove mmap limit

5 years agoFix bug #77930: Remove mmap limit
Nikita Popov [Wed, 30 Oct 2019 12:15:05 +0000 (13:15 +0100)]
Fix bug #77930: Remove mmap limit

First, the limitation already doesn't trigger if you copy the whole
file (i.e. use copy() or stream_copy_to_stream() and don't specify
a length). This happens because length will be 0 at the time of the
check and only later calculated based on the file size. This means
that we're already completely blowing the length limit for what is
likely the most common case, and it doesn't seem like anyone complained
about that.

Second, the premise of the code comment ("to avoid runaway swapping")
seems incorrect to me. Because this performs a file-backed non-private
mmap, no swap backing is needed for the mapping. Concerns over "memory
usage" are also misplaced, as this is a virtual mapping.

5 years agoElevate warnings to ValueErrors in ext/calendar
Christoph M. Becker [Mon, 28 Oct 2019 07:53:56 +0000 (08:53 +0100)]
Elevate warnings to ValueErrors in ext/calendar

All of these warnings/ValueErrors are due to programming errors, i.e.
calling a function with unsupported arguments.

5 years agoMerge branch 'PHP-7.4'
Christoph M. Becker [Wed, 30 Oct 2019 18:50:22 +0000 (19:50 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Fix #78761: Zend memory heap corruption with preload and casting

5 years agoFix #78761: Zend memory heap corruption with preload and casting
Christoph M. Becker [Wed, 30 Oct 2019 17:05:10 +0000 (18:05 +0100)]
Fix #78761: Zend memory heap corruption with preload and casting

We have to reset `FFI_G(persistent)` back to zero when preloading has
finished.

5 years agoMerge branch 'PHP-7.4'
Christoph M. Becker [Wed, 30 Oct 2019 16:22:56 +0000 (17:22 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Fix #78762: Failing FFI::cast() may leak memory

5 years agoFix #78762: Failing FFI::cast() may leak memory
Christoph M. Becker [Wed, 30 Oct 2019 16:16:56 +0000 (17:16 +0100)]
Fix #78762: Failing FFI::cast() may leak memory

We have to release objects when we're done with them.

5 years agoCleanup return values when parameter parsing is unsuccessful
Máté Kocsis [Tue, 29 Oct 2019 16:16:27 +0000 (17:16 +0100)]
Cleanup return values when parameter parsing is unsuccessful

5 years agoCleanup return values for Intl when parameter parsing is unsuccessful
Máté Kocsis [Tue, 29 Oct 2019 14:45:46 +0000 (15:45 +0100)]
Cleanup return values for Intl when parameter parsing is unsuccessful

Closes GH-4871.

5 years agoDon't use chunking for stream writes
Nikita Popov [Thu, 18 Jul 2019 15:02:29 +0000 (17:02 +0200)]
Don't use chunking for stream writes

We're currently splitting up large writes into 8K size chunks, which
adversely affects I/O performance in some cases. Splitting up writes
doesn't make a lot of sense, as we already must have a backing buffer,
so there is no memory/performance tradeoff to be made here.

This change disables the write chunking at the stream layer, but
retains the current retry loop for partial writes. In particular
network writes will typically only write part of the data for large
writes, so we need to keep the retry loop to preserve backwards
compatibility.

If issues due to this change turn up, chunking should be reintroduced
at lower levels where it is needed to avoid issues for specific streams,
rather than unnecessarily enforcing it for all streams.

5 years agoMerge branch 'PHP-7.4'
Nikita Popov [Wed, 30 Oct 2019 10:32:08 +0000 (11:32 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Add UPGRADING note for stream_read() change

[ci skip]

5 years agoAdd UPGRADING note for stream_read() change
Nikita Popov [Wed, 30 Oct 2019 10:31:28 +0000 (11:31 +0100)]
Add UPGRADING note for stream_read() change

Ref bug #78575.

[ci skip]

5 years agoAdd more openssl stubs
Rimvydas Zilinskas [Wed, 30 Oct 2019 10:20:48 +0000 (11:20 +0100)]
Add more openssl stubs

Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
5 years agoMerge branch 'PHP-7.4'
Nikita Popov [Wed, 30 Oct 2019 10:06:59 +0000 (11:06 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Optimize creation of empty arrays in json_decode

5 years agoOptimize creation of empty arrays in json_decode
Tyson Andre [Fri, 25 Oct 2019 23:57:39 +0000 (19:57 -0400)]
Optimize creation of empty arrays in json_decode

Use the shared empty array from ZVAL_EMPTY_ARRAY

For code that created an 10 arrays of 100000 empty arrays
(has the same result with `$assoc=true` and `{}`)

- This is the worst-case comparison, but I'd expect 0-length arrays to be fairly
  common in regular data for json_decode
- The parser implementation was using function pointers so that third party
  extension developers could reuse the json parser for their own
  data structures, etc. (I think).

  This PR is meant to let those third party extensions continue working
  without changes.

Before this patch: In 0.126 seconds: added 97.99 MiB
After this patch:  In 0.096 seconds: added 41.99 MiB

```php
<?php
$json = '[' . str_repeat('[],', 100000) . "null]";
$start_memory = memory_get_usage();
$start_time = microtime(true);
$result = [];
for ($i = 0; $i < 10; $i++) {
    $result[] = json_decode($json);
}
$end_memory = memory_get_usage();
$end_time = microtime(true);
// Before this patch: In 0.126 seconds: added 97.99 MiB
// After this patch:  In 0.096 seconds: added 41.99 MiB
printf("In %.3f seconds: added %.2f MiB\n", $end_time - $start_time, ($end_memory - $start_memory)/1000000);

// For objects
$json = '[' . str_repeat('{},', 100000) . "null]";
$start_memory = memory_get_usage();
$start_time = microtime(true);
for ($i = 0; $i < 10; $i++) {
    $result[] = json_decode($json, true);
}
$end_memory = memory_get_usage();
$end_time = microtime(true);
// Before this patch: In 0.126 seconds: added 97.99 MiB
// After this patch:  In 0.096 seconds: added 41.99 MiB
printf("In %.3f seconds: added %.2f MiB (objects decoded as arrays) \n", $end_time - $start_time, ($end_memory - $start_memory)/1000000);
```

Closes GH-4861.

5 years agoMake "unterminated comment" into a parse error
Nikita Popov [Wed, 30 Oct 2019 10:00:27 +0000 (11:00 +0100)]
Make "unterminated comment" into a parse error

5 years agoWarn on strtr(["" => "x"])
Nikita Popov [Mon, 7 Oct 2019 11:04:06 +0000 (13:04 +0200)]
Warn on strtr(["" => "x"])

Previously:
 * If only ["" => "x"] was present, the original string was returned
   without warning.
 * If both ["" => "x"] and at least one more element was present,
   false was returned without warning.

New behavior:
 * Ignore "" keys in the replacement array (and perform any remaining
   replacement).
 * Throw a warning indicating that an empty string replacement has
   been ignored.

Closes GH-4792.

5 years agoPromote mt_rand() min/max warning to ValueError
Nikita Popov [Wed, 30 Oct 2019 09:36:42 +0000 (10:36 +0100)]
Promote mt_rand() min/max warning to ValueError

5 years agoAdd stubs for various standard functions
Máté Kocsis [Wed, 23 Oct 2019 12:46:59 +0000 (14:46 +0200)]
Add stubs for various standard functions

Closes GH-4851.

5 years agoUse ArgumentCountError in IntlGregorianCalendar ctor
Nikita Popov [Tue, 29 Oct 2019 23:48:28 +0000 (19:48 -0400)]
Use ArgumentCountError in IntlGregorianCalendar ctor

5 years agoUpdate documentation/comment for GH-4860
Tyson Andre [Tue, 29 Oct 2019 23:48:28 +0000 (19:48 -0400)]
Update documentation/comment for GH-4860

Fix folding for the new helper method.

Clarify comment in UPGRADING:
The performance on associative arrays would also improve,
as long as no offsets were unset (no gaps).
Packed arrays can have gaps.

Closes GH-4873.
[ci skip]

5 years agoAdd stubs for directory and file functions
Máté Kocsis [Mon, 28 Oct 2019 17:56:49 +0000 (18:56 +0100)]
Add stubs for directory and file functions

5 years agoDon't check $this existence in object opcodes
Nikita Popov [Wed, 13 Feb 2019 10:37:32 +0000 (11:37 +0100)]
Don't check $this existence in object opcodes

We are now guaranteed that $this always exists inside methods, as
well as insides closures (if they use $this at all).

This removes checks for $this existence from the individual object
opcodes. Instead ZEND_FETCH_THIS is used in the cases where $this
is not guaranteed to exist, which is mainly the pseudo-main scope.

Closes GH-3822.

5 years agoMerge branch 'PHP-7.4'
Nikita Popov [Wed, 30 Oct 2019 08:23:23 +0000 (09:23 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Add missing refcount increment

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Nikita Popov [Wed, 30 Oct 2019 08:23:06 +0000 (09:23 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Add missing refcount increment

5 years agoMerge branch 'PHP-7.2' into PHP-7.3
Nikita Popov [Wed, 30 Oct 2019 08:22:37 +0000 (09:22 +0100)]
Merge branch 'PHP-7.2' into PHP-7.3

* PHP-7.2:
  Add missing refcount increment

5 years agoAdd missing refcount increment
Nikita Popov [Wed, 30 Oct 2019 08:22:20 +0000 (09:22 +0100)]
Add missing refcount increment

5 years agoFix bug #78681 by renaming libphp8.so to libphp.so
Nikita Popov [Tue, 29 Oct 2019 15:01:59 +0000 (16:01 +0100)]
Fix bug #78681 by renaming libphp8.so to libphp.so

The major version number is no longer included.

5 years agoAllow to call XMLReader::open() and ::XML() statically
Christoph M. Becker [Fri, 11 Oct 2019 14:41:07 +0000 (16:41 +0200)]
Allow to call XMLReader::open() and ::XML() statically

The implementation of `XMLReader::open()` and `XMLReader::XML()` still
supports calling the methods statically and non-statically.  However,
as of PHP 8.0.0, calling these methods statically is not allowed,
because they are not declared as static methods.  Since we consider it
to be cleaner to call these methods statically, but had deprecated to
call them statically, we properly support both variants.

We implement support for static and non-static calls by overloading, so
that non-static calls have access to the `$this` pointer.

5 years agoMerge branch 'PHP-7.4'
Nikita Popov [Tue, 29 Oct 2019 14:08:03 +0000 (15:08 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Fixed bug #78689

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Nikita Popov [Tue, 29 Oct 2019 14:07:28 +0000 (15:07 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fixed bug #78689

5 years agoMerge branch 'PHP-7.2' into PHP-7.3
Nikita Popov [Tue, 29 Oct 2019 14:06:28 +0000 (15:06 +0100)]
Merge branch 'PHP-7.2' into PHP-7.3

* PHP-7.2:
  Fixed bug #78689

5 years agoFixed bug #78689
Nikita Popov [Tue, 29 Oct 2019 14:05:59 +0000 (15:05 +0100)]
Fixed bug #78689

5 years agoRemove some RETURN_FALSE on exception
Nikita Popov [Tue, 29 Oct 2019 12:36:03 +0000 (13:36 +0100)]
Remove some RETURN_FALSE on exception

5 years agoAdd Z_PARAM_STRING/ARRAY_OR_NULL convenience macros
Nikita Popov [Tue, 29 Oct 2019 12:29:52 +0000 (13:29 +0100)]
Add Z_PARAM_STRING/ARRAY_OR_NULL convenience macros

5 years agoDon't accept objects for options in password_hash()
Nikita Popov [Tue, 29 Oct 2019 12:20:22 +0000 (13:20 +0100)]
Don't accept objects for options in password_hash()

This was likely a mixup of zpp modifiers in the original implementation.
Per the RFC only arrays should be accepted here.

5 years agoPromote base_convert "invalid base" errors to ValueError
Nikita Popov [Tue, 29 Oct 2019 12:12:37 +0000 (13:12 +0100)]
Promote base_convert "invalid base" errors to ValueError

5 years agoThrow "Unsupported operand types" error when using ** on arrays
Nikita Popov [Tue, 29 Oct 2019 12:05:02 +0000 (13:05 +0100)]
Throw "Unsupported operand types" error when using ** on arrays

5 years agoExpect number argument in round()
Nikita Popov [Tue, 29 Oct 2019 11:49:42 +0000 (12:49 +0100)]
Expect number argument in round()

5 years agoConvert phpdbg arginfo to php stubs
Craig Duncan [Sun, 27 Oct 2019 21:46:11 +0000 (21:46 +0000)]
Convert phpdbg arginfo to php stubs

Closes GH-4867.

5 years agoSmall phpdbg cleanups
Nikita Popov [Tue, 29 Oct 2019 10:39:02 +0000 (11:39 +0100)]
Small phpdbg cleanups

Add a zpp_none() call, convert E_ERROR to ValueError.

5 years agoSmall ext/dom cleanups
Nikita Popov [Tue, 29 Oct 2019 10:15:08 +0000 (11:15 +0100)]
Small ext/dom cleanups

5 years agoMerge branch 'PHP-7.4'
Christoph M. Becker [Tue, 29 Oct 2019 09:07:22 +0000 (10:07 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Skip test case on non Windows platforms

5 years agoSkip test case on non Windows platforms
Christoph M. Becker [Tue, 29 Oct 2019 09:05:31 +0000 (10:05 +0100)]
Skip test case on non Windows platforms

5 years agoTry to fix asan warning in scalar_constant_defaults.phpt
Nikita Popov [Tue, 29 Oct 2019 08:57:29 +0000 (09:57 +0100)]
Try to fix asan warning in scalar_constant_defaults.phpt

Doing the SAVE_VALID_OPLINE right before the call, because we
still need r0 before that.

5 years agoMerge branch 'PHP-7.4'
Derick Rethans [Tue, 29 Oct 2019 09:00:45 +0000 (09:00 +0000)]
Merge branch 'PHP-7.4'

5 years agoMerge branch 'PHP-7.4'
Christoph M. Becker [Tue, 29 Oct 2019 08:57:27 +0000 (09:57 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Skip test case on non Windows platforms

5 years agoSkip test case on non Windows platforms
Christoph M. Becker [Tue, 29 Oct 2019 08:53:44 +0000 (09:53 +0100)]
Skip test case on non Windows platforms

5 years agoTry to fix 32-bit fprintf test
Nikita Popov [Tue, 29 Oct 2019 08:52:46 +0000 (09:52 +0100)]
Try to fix 32-bit fprintf test

5 years agoUpdate NEWS for 7.4.0RC6
Derick Rethans [Tue, 29 Oct 2019 08:50:32 +0000 (08:50 +0000)]
Update NEWS for 7.4.0RC6

5 years agoUpdate NEWS for PHP 7.4.0RC5
Derick Rethans [Tue, 29 Oct 2019 08:49:13 +0000 (08:49 +0000)]
Update NEWS for PHP 7.4.0RC5

5 years agoFix test cases for master
Christoph M. Becker [Tue, 29 Oct 2019 08:34:15 +0000 (09:34 +0100)]
Fix test cases for master

5 years agoMerge branch 'PHP-7.4'
Christoph M. Becker [Tue, 29 Oct 2019 07:58:17 +0000 (08:58 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Implement #78270: Support __vectorcall convention with FFI

5 years agoImplement #78270: Support __vectorcall convention with FFI
Christoph M. Becker [Mon, 14 Oct 2019 12:56:37 +0000 (14:56 +0200)]
Implement #78270: Support __vectorcall convention with FFI

To work around the limitation of the current rudimentary vectorcall
support in our patched libffi, we forbid yet unsupported declarations,
i.e. float/double parameters at certain positions (SIMD vector types
and HVA types are not supported anyway).

5 years agoMerge branch 'PHP-7.4'
Stanislav Malyshev [Tue, 29 Oct 2019 03:47:57 +0000 (20:47 -0700)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Fix libmagic buffer overflow issue (CVE-2019-18218)
  bump version
  set versions for release

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Stanislav Malyshev [Tue, 29 Oct 2019 03:47:50 +0000 (20:47 -0700)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix libmagic buffer overflow issue (CVE-2019-18218)
  bump version
  set versions for release

5 years agoMerge branch 'PHP-7.2' into PHP-7.3
Stanislav Malyshev [Tue, 29 Oct 2019 03:47:44 +0000 (20:47 -0700)]
Merge branch 'PHP-7.2' into PHP-7.3

* PHP-7.2:
  Fix libmagic buffer overflow issue (CVE-2019-18218)
  bump version
  set versions for release

5 years agoMerge branch 'PHP-7.1' into PHP-7.2
Stanislav Malyshev [Tue, 29 Oct 2019 03:47:30 +0000 (20:47 -0700)]
Merge branch 'PHP-7.1' into PHP-7.2

* PHP-7.1:
  Fix libmagic buffer overflow issue (CVE-2019-18218)
  bump version
  set versions for release

5 years agoMerge branch 'PHP-7.4'
Christoph M. Becker [Mon, 28 Oct 2019 15:41:16 +0000 (16:41 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Add support for Interbase 1 dialect

5 years agoAdd support for Interbase 1 dialect
Simonov Denis [Fri, 25 Oct 2019 16:38:01 +0000 (18:38 +0200)]
Add support for Interbase 1 dialect

5 years agoAdd missing zend_parse_parameters_none()
Christoph M. Becker [Sun, 27 Oct 2019 12:12:45 +0000 (13:12 +0100)]
Add missing zend_parse_parameters_none()

We fix the trivial cases; some others need further discussion, see
<https://news-web.php.net/php.internals/107723>.

5 years agoRemove ability to unbind $this of closures if used
Nikita Popov [Mon, 28 Oct 2019 12:24:07 +0000 (13:24 +0100)]
Remove ability to unbind $this of closures if used

This was deprecated in PHP 7.4, removing it for PHP 8.0.

5 years agoDefine IS_WINDOWS in the test runner
Fabien Villepinte [Mon, 28 Oct 2019 12:14:50 +0000 (13:14 +0100)]
Define IS_WINDOWS in the test runner

Avoid code duplication

Closes GH-4866.

5 years agoMerge branch 'PHP-7.4'
Christoph M. Becker [Mon, 28 Oct 2019 12:09:44 +0000 (13:09 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Fix #78751: Serialising DatePeriod converts DateTimeImmutable

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Mon, 28 Oct 2019 12:09:11 +0000 (13:09 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #78751: Serialising DatePeriod converts DateTimeImmutable

5 years agoMerge branch 'PHP-7.2' into PHP-7.3
Christoph M. Becker [Mon, 28 Oct 2019 12:08:06 +0000 (13:08 +0100)]
Merge branch 'PHP-7.2' into PHP-7.3

* PHP-7.2:
  Fix #78751: Serialising DatePeriod converts DateTimeImmutable

5 years agoFix #78751: Serialising DatePeriod converts DateTimeImmutable
Christoph M. Becker [Fri, 25 Oct 2019 13:43:38 +0000 (15:43 +0200)]
Fix #78751: Serialising DatePeriod converts DateTimeImmutable

When getting the properties of a DatePeriod instance we have to retain
the proper classes, and when restoring a DatePeriod instance we have to
cater to DateTimeImmutable instances as well.

5 years agoElevate warnings to Error Exceptions in ext/bcmath
Christoph M. Becker [Mon, 28 Oct 2019 10:59:20 +0000 (11:59 +0100)]
Elevate warnings to Error Exceptions in ext/bcmath

`bcdiv()` and `bcmod()` throw DivisionByZeroError if the divisor is 0,
which matches the behavior of the `/` and `%` operators, and `bcsqrt()`
throws ValueError for negative operands.

5 years agoConvert warnings to Errors in sprintf() functions
kharhamel [Tue, 15 Oct 2019 15:51:39 +0000 (17:51 +0200)]
Convert warnings to Errors in sprintf() functions

Closes GH-4837.

5 years agoFix miscellaneous typos in docs and error messages
Tyson Andre [Sun, 27 Oct 2019 03:44:36 +0000 (23:44 -0400)]
Fix miscellaneous typos in docs and error messages

Closes GH-4863.

5 years agoMerge branch 'PHP-7.4'
Nikita Popov [Mon, 28 Oct 2019 10:42:57 +0000 (11:42 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Remove redundant variable rv and optimize code

5 years agoRemove redundant variable rv and optimize code
ZiMuyang [Sun, 27 Oct 2019 15:21:31 +0000 (23:21 +0800)]
Remove redundant variable rv and optimize code

Closes GH-4864.

5 years agoOptimize array_slice for packed arrays with large offsets
Tyson Andre [Fri, 25 Oct 2019 13:31:06 +0000 (09:31 -0400)]
Optimize array_slice for packed arrays with large offsets

If the offset is 100000, and there are no gaps in the packed/unpacked array,
then advance the pointer once by 100000,
instead of looping and skipping 100000 times.

Add a new test of array_slice handling unset offsets.

Closes GH-4860.

5 years agoMerge branch 'PHP-7.4'
Nikita Popov [Mon, 28 Oct 2019 09:28:24 +0000 (10:28 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Fix bug #78752

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Nikita Popov [Mon, 28 Oct 2019 09:28:14 +0000 (10:28 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix bug #78752

5 years agoMerge branch 'PHP-7.2' into PHP-7.3
Nikita Popov [Mon, 28 Oct 2019 09:27:46 +0000 (10:27 +0100)]
Merge branch 'PHP-7.2' into PHP-7.3

* PHP-7.2:
  Fix bug #78752

5 years agoFix bug #78752
Nikita Popov [Mon, 28 Oct 2019 09:23:20 +0000 (10:23 +0100)]
Fix bug #78752

NULL out the execute_data before destroying it, otherwise GC may
trigger while the execute_data is partially destroyed, resulting
in double-frees.

The handling of call stack unfreezing is a bit awkward because it's
a ZEND_API function, so we can't change the signature.

5 years agoFix libmagic buffer overflow issue (CVE-2019-18218)
Stanislav Malyshev [Sun, 27 Oct 2019 23:30:38 +0000 (16:30 -0700)]
Fix libmagic buffer overflow issue (CVE-2019-18218)

Ported from https://github.com/file/file/commit/46a8443f76cec4b41ec736eca396984c74664f84

5 years agoRevert "Add missing zend_parse_parameters_none()"
Christoph M. Becker [Sun, 27 Oct 2019 12:41:41 +0000 (13:41 +0100)]
Revert "Add missing zend_parse_parameters_none()"

This reverts commit ef439ec895a97a12e8f88c3371dfc8881a501649.
Test failures need to be resolved first.

5 years agoAdd missing zend_parse_parameters_none()
Christoph M. Becker [Sun, 27 Oct 2019 12:12:45 +0000 (13:12 +0100)]
Add missing zend_parse_parameters_none()

5 years agoMerge branch 'PHP-7.4'
Nikita Popov [Sun, 27 Oct 2019 08:36:44 +0000 (09:36 +0100)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Try one more FD in ext/standard/tests/file/php_fd_wrapper_04.phpt

5 years agoTry one more FD in ext/standard/tests/file/php_fd_wrapper_04.phpt
Nikita Popov [Sun, 27 Oct 2019 08:33:46 +0000 (09:33 +0100)]
Try one more FD in ext/standard/tests/file/php_fd_wrapper_04.phpt

For some reason FD 120 seems to exist on macos quite often, while
FD 12 did not... Let's try an even larger number, otherwise we
should just drop this test.

5 years agoRemove generic type annotations
Christoph M. Becker [Sat, 26 Oct 2019 14:24:02 +0000 (16:24 +0200)]
Remove generic type annotations

Cf. <https://github.com/php/php-src/commit/de69a9d3ebad41da9bc7c59f836bb141f0af70f8#r35675846>.

5 years agoFix and make reflection arginfo stubs more specific
Christoph M. Becker [Sat, 26 Oct 2019 14:15:19 +0000 (16:15 +0200)]
Fix and make reflection arginfo stubs more specific