1
0
mirror of https://github.com/php/php-src.git synced 2026-04-04 22:52:40 +02:00
Commit Graph

116415 Commits

Author SHA1 Message Date
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
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
Stanislav Malyshev
686a24c1eb Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix bug #78804 - Segmentation fault in Locale::filterMatches
2019-11-11 23:08:44 -08:00
Stanislav Malyshev
ea2a125789 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix bug #78804 - Segmentation fault in Locale::filterMatches
2019-11-11 23:08:38 -08:00
Stanislav Malyshev
2c9926f156 Fix bug #78804 - Segmentation fault in Locale::filterMatches 2019-11-11 22:32:35 -08:00
Christoph M. Becker
735c4cab74 Make test more resilient
`socket_bind()` may raise `E_WARNING` on failure, which would cause the
test to fail.
2019-11-11 18:08:54 +01:00
Christoph M. Becker
8c5ca24e11 Fix clean section of test case 2019-11-11 15:57:42 +01:00
Christoph M. Becker
dccd137e1a iconv_strlen() cannot return a string 2019-11-11 15:40:59 +01:00
Máté Kocsis
27e83d0fb8 Add union return types for function stubs 2019-11-11 14:54:55 +01:00
Christoph M. Becker
2804ea6127 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix test case for Windows
2019-11-11 12:56:55 +01:00
Christoph M. Becker
ce047e6091 Fix test case for Windows 2019-11-11 12:49:32 +01:00
Christoph M. Becker
0a33536526 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix test cases which fail on Windows debug builds
2019-11-11 12:34:50 +01:00
Christoph M. Becker
60081ca20d Fix test cases which fail on Windows debug builds
We use the portable {TMP} instead of the hard-coded /tmp, and skip
mysqli_debug_append.phpt on Windows, because unlinking the trace file
while the connection is still open won't work there.
2019-11-11 12:14:38 +01:00
Christoph M. Becker
adcc35916a Properly declare methods
While declaring methods with `PHP_FALIAS` kind of works, it is
semantically confusing, and also doesn't allow to specify access flags.
2019-11-11 10:58:21 +01:00
Dmitry Stogov
6e9dd13d63 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #78714 (funcs returning pointer can't use call convention spec)
2019-11-11 12:09:47 +03:00
Dmitry Stogov
ecd0c5b6ad Fixed bug #78714 (funcs returning pointer can't use call convention spec) 2019-11-11 12:07:48 +03:00
Christoph M. Becker
b0391c3e26 Revert "Fix #78790: mysqli_get_client_info() expects exactly 0 parameters"
This reverts commit 87fad8cdf0, since,
apparently, `mysqli_get_client_info()` is also supposed to be called
without argument.
2019-11-11 10:06:21 +01:00
Christoph M. Becker
87fad8cdf0 Fix #78790: mysqli_get_client_info() expects exactly 0 parameters
`mysqli_get_client_info()` and `mysqli_thread_safe()` can also be
called as methods, so we have to cater to this when parsing the
arguments.
2019-11-11 10:01:17 +01:00
Benjamin Eberlei
3b34c4fa12 Merge branch 'DomFaliasCleanup' 2019-11-09 21:30:25 +01:00
Benjamin Eberlei
f905a81979 ext/dom: Replace usages of PHP_FUNCTION and aliases with PHP_METHOD. 2019-11-09 21:29:42 +01:00
Benjamin Eberlei
ee80567a83 Merge branch 'dom-arginfo-stubs' 2019-11-09 15:16:09 +01:00
Fabien Villepinte
1240c122a1 Merge branch 'PHP-7.4' 2019-11-09 13:56:23 +01:00
Fabien Villepinte
ce41795a9f Fix conflicts in windows ACL tests
Closes GH-4898.
2019-11-09 13:55:42 +01:00
Fabien Villepinte
4d529757f8 Merge branch 'PHP-7.4' 2019-11-08 20:36:55 +01:00
Fabien Villepinte
9c4b989c75 Make test runner runnable without arguments
The default PHP executable was not set when no args were provided.

Closes GH-4894.
2019-11-08 20:33:19 +01:00
Nikita Popov
9bbbc9e7e9 Add support for union types in stubs
This is the MVP for supporting union types in PHP stubs. Return
types with only builtin types work, which is the part we mainly
need.

Closes GH-4895.
2019-11-08 17:32:18 +01:00
Tyson Andre
70b4bc963c Fix compile error using zend_parse_parameters_throw()
Fixes a bug introduced in 4008704f62

The trailing comma is followed by `)` when the varargs list
is empty in the macro, which is a syntax error in C

This fixes compilation of code such as the following

    PHP_FUNCTION(get_metadata) {
      if (zend_parse_parameters_throw(ZEND_NUM_ARGS(), "") == FAILURE) {
        return;
      }

Closes GH-4896.
2019-11-08 16:29:10 +01:00
Levi Morrison
1cb69c44d7 Merge branch 'PHP-7.4' 2019-11-08 08:04:52 -07:00
Levi Morrison
05bce66037 Merge branch 'PHP-7.3' into PHP-7.4 2019-11-08 08:02:49 -07:00