Commit Graph

116442 Commits

Author SHA1 Message Date
Craig Duncan
e208d236b3 Convert apache2handler arginfo to php stubs 2019-11-18 15:07:04 +01:00
Michael Voříšek
7a5dbcd660 Remove clearstatcache function prototype defned twice 2019-11-18 14:36:10 +01:00
Fabien Villepinte
f67b27fac6 Fix typo in pcntl_sigwaitinfo proto 2019-11-18 12:53:36 +01:00
Christoph M. Becker
c58b44f34a Merge branch 'PHP-7.4'
* PHP-7.4:
  Update NEWS
2019-11-18 12:49:28 +01:00
Christoph M. Becker
bcb8ab304e Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Update NEWS
2019-11-18 12:48:55 +01:00
Christoph M. Becker
3b46fbfc36 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Update NEWS
2019-11-18 12:47:53 +01:00
Christoph M. Becker
f6eac76b65 Update NEWS 2019-11-18 12:46:43 +01:00
Fabien Villepinte
2adb1bba17 Fix proto of forward_static_call_array
Closes GH-4928.
2019-11-18 12:46:05 +01:00
Máté Kocsis
c58b12334d Add union return types with one class 2019-11-18 12:44:38 +01:00
Máté Kocsis
100552d4b5 Add stubs for PDO 2019-11-18 12:38:10 +01:00
Craig Duncan
a9e8cd2b6b Convert the example skeleton extension to use arginfo stubs 2019-11-18 11:41:24 +01:00
Tyson Andre
7901913b83 Speed up foreach/FE_FREE (optimize for arrays without gc)
In the case where there are still references to an array being iterated
over when the iterator is freed (or the array is not reference counted):

- There's need to save the opline.
- There's no need to check for exceptions.

```
// Before: 0.404 seconds
// After:  0.362 seconds
// loop_iter_empty(1000, 5000);
function loop_iter_empty(int $a, int $b) {
  $values = array_fill(0, $b, []);
  $total = 0;
  for ($i = 0; $i < $b; $i++) {
      foreach ($values as $v) {
          foreach ($v as $x) {
              $total += $x;
          }
      }
  }
  return $total;
}
```
2019-11-18 11:54:35 +03:00
Dmitry Stogov
8bf663d3b2 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix $x = (bool)$x; for undefined with opcache
2019-11-18 11:29:38 +03:00
Dmitry Stogov
be6fb13873 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix $x = (bool)$x; for undefined with opcache
2019-11-18 11:27:43 +03:00
Dmitry Stogov
e72e3370c6 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix $x = (bool)$x; for undefined with opcache
2019-11-18 11:26:30 +03:00
Tyson Andre
a2c41c0ea6 Fix $x = (bool)$x; for undefined with opcache
And `$x = !$x`

Noticed while working on GH-4912

The included test would not emit undefined variable errors in php 8.0
with opcache enabled. The command used:

```
php -d zend_extension=opcache.so --no-php-ini -d error_reporting=E_ALL \
    -d opcache.file_cache= -d opcache.enable_cli=1  test.php
```
2019-11-18 11:24:03 +03:00
Jakub Zelenka
f826bbde93 Merge branch 'PHP-7.4' 2019-11-17 14:53:53 +00:00
Jakub Zelenka
29c7c9e8ed Add NEWS entry for bug #76601 fix 2019-11-17 14:52:36 +00:00
Maksim Nikulin
e37bd5dcc2 Do not let PHP-FPM children miss SIGTERM, SIGQUIT
Postpone signal delivery while spawning children.
Prevent the following case:

- Reload (reexec) is in progress.
- New master is forking to start enough children for pools
  where `pm` is not `on-demand`.
- Another `SIGUSR2` is received by the master process.
- Master process switches to reloading state.
- Some child has not set its own signal handlers.
- `SIGQUIT` and `SIGTERM` sent by master process are caught
  by signal handler set by master process and so they are ignored.
- A child is running, it has no reason to finish

Before pull request #4465 this scenario could cause deadlock,
however with 0ed6c37140 reload finishes after `SIGKILL`.

Use sigprocmask() around fork() to avoid race of delivery signal to children
and setting of own signal handlers.

Fixes bug #76601
2019-11-17 14:46:56 +00:00
Christoph M. Becker
5b9725e555 Add missing zend_parse_parameters_none() 2019-11-16 18:20:39 +01:00
Máté Kocsis
65db340ae7 Add stubs for the Locale component of Intl 2019-11-16 18:15:03 +01:00
Nikita Popov
292a1aeb59 Support union types for args in gen stubs
Using this requires care! The zpp implementation for this union
must be consistent with the arginfo implementation!

Apart from array|object, this is probably only the case for
int|float right now.
2019-11-15 17:33:37 +01:00
Nikita Popov
0cec268d15 Support single class unions in gen stubs 2019-11-15 17:19:26 +01:00
Nikita Popov
468ecf295d Fix DateTimeImmutable stubs
These were referencing the arginfo from the functions, instead of
the methods, which isn't right, as the functions have return types.
2019-11-15 16:02:26 +01:00
Nikita Popov
9899fdc454 Merge branch 'PHP-7.4'
* PHP-7.4:
  Handle reallocated root buffer during GC destroy phase
  Zend Engine version is no longer in -dev
2019-11-15 15:54:46 +01:00
Nikita Popov
3f4a15113c Handle reallocated root buffer during GC destroy phase
We no longer protect GC during the destroy phase, so we need to
deal with buffer reallocation.

Possible fix for bug #78811.
2019-11-15 15:53:49 +01:00
Tyson Andre
a7580899f3 Support the same handler for multiple opcodes 2019-11-15 17:37:01 +03:00
Tyson Andre
e8525c2f68 Optimize int === int/double === double
Do this by reusing the implementation used for `==`
when both arguments are ints (IS_LONG) or both are floats (IS_DOUBLE)

```php
// Before: nestedloop_ni took 0.442 seconds
// After: nestedloop_ni takes 0.401 seconds (same as nestedloop_ne)
function nestedloop_ni(int $k) {
  $x = 0;
  for ($i=0; $i < 50000000; $i++) {
    if ($i === $k) {
      $x++;
    }
  }
  print "$x\n";
}
function nestedloop_ne(int $k) {
  $x = 0;
  for ($i=0; $i < 50000000; $i++) {
    if ($i == $k) {
        $x++;
    }
  }
  print "$x\n";
}
```
2019-11-15 17:37:01 +03:00
Derick Rethans
51ac4e302c Zend Engine version is no longer in -dev 2019-11-15 14:27:20 +00:00
Derick Rethans
17a021e228 Merge branch 'PHP-7.4' 2019-11-15 14:22:41 +00:00
Derick Rethans
e99406f4d1 PHP-7.4 is now 7.4.1-dev 2019-11-15 14:22:14 +00:00
Nikita Popov
40dcf2bd3d password_hash() can't return false 2019-11-15 12:43:57 +01:00
Nikita Popov
bb41a1b7e7 Fix str_pad rc info
This fixes at least part of bug #78811.
2019-11-15 12:37:24 +01:00
Nikita Popov
716fdacdd1 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #78810
2019-11-15 12:08:55 +01:00
Nikita Popov
266f3a02bc Fixed bug #78810 2019-11-15 12:06:17 +01:00
Christoph M. Becker
03b7833558 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix ASLR related invalid opline handler issues
2019-11-15 09:48:02 +01:00
Christoph M. Becker
a5683e65da Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix ASLR related invalid opline handler issues
2019-11-15 09:47:34 +01:00
Christoph M. Becker
39d04f15f8 Fix ASLR related invalid opline handler issues
Opcache stores `opline->handler`s in shared memory.  These pointers are
invalid, if the main PHP DLL is loaded at another base address due to
ASLR.  We therefore store the address of `execute_ex` in the mmap base
file, and check on startup whether it matches its current address.  If
not, we fall back on the file cache if enabled, and bail out otherwise.

This still does not address cases where the opline handler is located
inside of another DLL (e.g. for some profilers, debuggers), but there
seems to be no general solution for now.

(cherry picked from commit 8ba10b8fbc)
2019-11-15 09:46:58 +01:00
Christoph M. Becker
2de79f0855 Make the $num_points parameter of php_imagepolygon optional
That parameter is mostly useless in practise, and likely has been
directly ported from the underlying `gdImagePolygon()` and friends,
which require that parameter since the number of elements of the point
array would otherwise be unknown.  Typical usages of `imagepolygon()`,
`imageopenpolygon()` and `imagefilledpolygon()` pass `count($points)/2`
or hard-code this value as literal.  Since explicitly specifying this
parameter is annoying and error-prone, we offer the possibility to omit
it, in which case the `$points` array must have an even number of
elements, and the number of points is calculated as `count($points)/2`.
2019-11-15 09:41:10 +01:00
Fabien Villepinte
d65e59de9b Merge branch 'PHP-7.4' 2019-11-13 21:15:59 +01:00
Fabien Villepinte
92fd96531c Add more CONFLICTS tags
Closes GH-4908.
2019-11-13 20:59:23 +01:00
Dmitry Stogov
36afe4e39e Optimize $x === null into is_null($x) 2019-11-12 13:49:55 +03:00
Dmitry Stogov
bd45881014 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed wrong constant usage
2019-11-12 13:00:37 +03:00
Dmitry Stogov
49fcbb4810 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed wrong constant usage
2019-11-12 13:00:27 +03:00
Dmitry Stogov
9083e178f6 Fixed wrong constant usage 2019-11-12 12:59:50 +03:00
Dmitry Stogov
32274d81a1 Merge branch 'PHP-7.4'
* PHP-7.4:
  ws
2019-11-12 10:52:09 +03:00
Dmitry Stogov
c3f23642da ws 2019-11-12 10:51:55 +03:00
Dmitry Stogov
d94c27dcca Fixed JIT for TYPE_CHECK opcode (exception handling in case of undefined argument) 2019-11-12 10:42:29 +03:00
Tyson Andre
937fa6d9e2 Optimize is_scalar($x) into a TYPE_CHECK opcode
Optimizations such as specializations for is_resource were first added in
dfb4f6b38d9efedafab7d2d98b9333715561256

I don't see any mention of is_scalar (and optimizing it) in the commit history,
or in prior PRs on github, or searching for is_scalar in externals.io
2019-11-12 10:17:10 +03:00
Stanislav Malyshev
ad0a3f2886 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix bug #78804 - Segmentation fault in Locale::filterMatches
2019-11-11 23:08:52 -08:00