]> granicus.if.org Git - php/log
php
5 years agoFixed bug #77951
Nikita Popov [Thu, 9 May 2019 10:02:16 +0000 (12:02 +0200)]
Fixed bug #77951

Treat singleton references as non-references in ReflectionReference
and return null for them.

5 years agoRemove unused functions
Peter Kokot [Tue, 7 May 2019 01:07:21 +0000 (03:07 +0200)]
Remove unused functions

- zend_mm_bitset_find_zero
- zend_mm_bitset_find_one
- zend_mm_bitset_find_zero_and_set
- zend_is_by_ref_func_arg_fetch

5 years agoRemove redundant example/test libsodium.php file
Peter Kokot [Mon, 6 May 2019 00:10:06 +0000 (02:10 +0200)]
Remove redundant example/test libsodium.php file

5 years agoRemove unused example/test fileinfo.php script
Peter Kokot [Sun, 5 May 2019 23:48:50 +0000 (01:48 +0200)]
Remove unused example/test fileinfo.php script

5 years agoRemove example PHP script from FFI
Peter Kokot [Sun, 5 May 2019 23:40:15 +0000 (01:40 +0200)]
Remove example PHP script from FFI

FFI README.md already includes the PHP example with more information.

5 years agoRemove vcsclean script
Peter Kokot [Sat, 4 May 2019 15:28:24 +0000 (17:28 +0200)]
Remove vcsclean script

The vcsclean script is really only a wrapper for a git clean command.
Developers should use the more proper and clear native Git command
directly instead:
`git clean -Xfd`

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Wed, 8 May 2019 17:26:02 +0000 (19:26 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Add {TMP} placeholder for PHPT INI sections

5 years agoMerge branch 'PHP-7.2' into PHP-7.3
Christoph M. Becker [Wed, 8 May 2019 17:22:21 +0000 (19:22 +0200)]
Merge branch 'PHP-7.2' into PHP-7.3

* PHP-7.2:
  Add {TMP} placeholder for PHPT INI sections

5 years agoAdd {TMP} placeholder for PHPT INI sections
Christoph M. Becker [Wed, 8 May 2019 15:54:02 +0000 (17:54 +0200)]
Add {TMP} placeholder for PHPT INI sections

Several tests use `/tmp` in the `--INI--` section, but this is not
portable.  We therefore introduce the `{TMP}` placeholder which
evaluates to the system's temporary directory using
`sys_get_temp_dir()`.

We also remove the doubtful `strpos()` optimization.

5 years agoUse fast zpp for ReflectionClass constructor
Nikita Popov [Wed, 8 May 2019 15:04:28 +0000 (17:04 +0200)]
Use fast zpp for ReflectionClass constructor

At this point zpp overhead makes up a significant part of this
function.

5 years agoImprove PHP hash function.
Dmitry Stogov [Wed, 8 May 2019 13:43:54 +0000 (16:43 +0300)]
Improve PHP hash function.
See Daniel Lemire's blog post https://lemire.me/blog/2016/07/21/accelerating-php-hashing-by-unoptimizing-it/

5 years agoOptimize $name/$class property population in reflection
Nikita Popov [Wed, 8 May 2019 13:30:53 +0000 (15:30 +0200)]
Optimize $name/$class property population in reflection

Instead of going through write_property, directly assign to the
respective property slot.

5 years agoRefactor inheritance type check implementation
Nikita Popov [Wed, 8 May 2019 10:11:12 +0000 (12:11 +0200)]
Refactor inheritance type check implementation

Extract the self/parent name resolution code and drop unnecessary
string copies/releases. Store the fe/proto types in local variables.

5 years agoDeduplicate inheritance type check implementation
Nikita Popov [Wed, 8 May 2019 09:24:08 +0000 (11:24 +0200)]
Deduplicate inheritance type check implementation

Make the check covariant (insofar as it is allowed now, i.e.
nullability and iterable) and call it with appropriate argument
order for both parameter and return types.

This makes it simpler to extend to full variance support.

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Nikita Popov [Wed, 8 May 2019 09:38:03 +0000 (11:38 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

5 years agoMerge branch 'PHP-7.2' into PHP-7.3
Nikita Popov [Wed, 8 May 2019 09:37:49 +0000 (11:37 +0200)]
Merge branch 'PHP-7.2' into PHP-7.3

5 years agoFix resolution of "parent" during inheritance check
Nikita Popov [Wed, 8 May 2019 09:33:13 +0000 (11:33 +0200)]
Fix resolution of "parent" during inheritance check

We can't assume that the method we're checking against is part of
the parent class...

5 years agoDeprecate CURLPIPE_HTTP1
Christoph M. Becker [Tue, 7 May 2019 15:05:07 +0000 (17:05 +0200)]
Deprecate CURLPIPE_HTTP1

`CURLPIPE_HTTP1` is deprecated and has no effect as of cURL 7.62.0[1].
We therefore deprecate the PHP constant as well, and trigger a warning
that it is no longer supported, if used against cURL 7.62.0 and up.

[1] <https://curl.haxx.se/libcurl/c/CURLMOPT_PIPELINING.html>

5 years ago[AArch64] Use NEON to initialize zend_hash
Sebastian Pop [Wed, 17 Apr 2019 15:03:37 +0000 (15:03 +0000)]
[AArch64] Use NEON to initialize zend_hash

On A72, google-benchmark measure before and after the patch:
--------------------------------------------------------------
Benchmark                    Time             CPU   Iterations
--------------------------------------------------------------
BM_hash_init_before       43.6 ns         43.6 ns     16052937
BM_hash_init_after        27.0 ns         27.0 ns     25877296

Patch written by Ali Saidi <alisaidi@amazon.com>
and Sebastian Pop <spop@amazon.com>

5 years agoAdd --with-ffi on Travis
Nikita Popov [Tue, 7 May 2019 12:32:06 +0000 (14:32 +0200)]
Add --with-ffi on Travis

5 years agoAvoid some maybe uninitialized warnings in ffi
Nikita Popov [Tue, 7 May 2019 13:21:08 +0000 (15:21 +0200)]
Avoid some maybe uninitialized warnings in ffi

All false positives.

5 years agospeed up increment and decrement operators with overflow detection
Sebastian Pop [Tue, 23 Apr 2019 20:18:39 +0000 (20:18 +0000)]
speed up increment and decrement operators with overflow detection

On A72, google-benchmark measure before and after the patch:
--------------------------------------------------------
Benchmark              Time             CPU   Iterations
--------------------------------------------------------
BM_inc_before       6.54 ns         6.54 ns    106985447
BM_dec_before       6.54 ns         6.54 ns    107011667
BM_inc_after        4.36 ns         4.36 ns    160525864
BM_dec_after        4.36 ns         4.36 ns    160524243

Before the patch:
fast_long_add_function:
ldr x0, [x1]
add x2, x0, 1
cmp x2, x0
blt .L11
str x2, [x1]
ret
.L11:
mov x0, 4890909195324358656
mov w2, 5
str x0, [x1]
str w2, [x1, 8]
ret

With the patch:
fast_long_add_function:
ldr x5, [x1]
adds x5,x5,1
bvs .L2
str x5, [x1]
ret
.L2:
mov x0, 4890909195324358656
mov w2, 5
str x0, [x1]
str w2, [x1, 8]
ret

    php$ ./sapi/cli/php Zend/bench.php

Base:                         Patch:
simple             0.091      simple             0.091
simplecall         0.014      simplecall         0.014
simpleucall        0.041      simpleucall        0.041
simpleudcall       0.045      simpleudcall       0.045
mandel             0.193      mandel             0.193
mandel2            0.229      mandel2            0.229
ackermann(7)       0.044      ackermann(7)       0.044
ary(50000)         0.010      ary(50000)         0.010
ary2(50000)        0.008      ary2(50000)        0.008
ary3(2000)         0.096      ary3(2000)         0.102
fibo(30)           0.149      fibo(30)           0.148
hash1(50000)       0.016      hash1(50000)       0.016
hash2(500)         0.020      hash2(500)         0.020
heapsort(20000)    0.055      heapsort(20000)    0.055
matrix(20)         0.057      matrix(20)         0.057
nestedloop(12)     0.091      nestedloop(12)     0.091
sieve(30)          0.032      sieve(30)          0.032
strcat(200000)     0.010      strcat(200000)     0.010
------------------------      ------------------------
Total              1.199      Total              1.204

    php$ ./sapi/cli/php Zend/micro_bench.php

Base:                                      Patch:
empty_loop         0.051                   empty_loop         0.050
func()             0.181    0.130          func()             0.181    0.131
undef_func()       0.186    0.135          undef_func()       0.186    0.136
int_func()         0.116    0.064          int_func()         0.116    0.065
$x = self::$x      0.235    0.183          $x = self::$x      0.229    0.179
self::$x = 0       0.198    0.147          self::$x = 0       0.199    0.148
isset(self::$x)    0.229    0.178          isset(self::$x)    0.225    0.174
empty(self::$x)    0.231    0.180          empty(self::$x)    0.227    0.177
$x = Foo::$x       0.144    0.093          $x = Foo::$x       0.142    0.092
Foo::$x = 0        0.107    0.056          Foo::$x = 0        0.105    0.054
isset(Foo::$x)     0.140    0.088          isset(Foo::$x)     0.140    0.089
empty(Foo::$x)     0.148    0.097          empty(Foo::$x)     0.144    0.094
self::f()          0.238    0.187          self::f()          0.240    0.190
Foo::f()           0.209    0.158          Foo::f()           0.201    0.150
$x = $this->x      0.123    0.072          $x = $this->x      0.120    0.070
$this->x = 0       0.124    0.073          $this->x = 0       0.124    0.074
$this->x += 2      0.151    0.099          $this->x += 2      0.151    0.101
++$this->x         0.137    0.086          ++$this->x         0.139    0.088
--$this->x         0.137    0.086          --$this->x         0.137    0.087
$this->x++         0.170    0.119          $this->x++         0.172    0.122
$this->x--         0.171    0.119          $this->x--         0.172    0.122
isset($this->x)    0.170    0.119          isset($this->x)    0.170    0.120
empty($this->x)    0.179    0.128          empty($this->x)    0.179    0.129
$this->f()         0.194    0.143          $this->f()         0.194    0.144
$x = Foo::TEST     0.188    0.137          $x = Foo::TEST     0.188    0.138
new Foo()          0.482    0.431          new Foo()          0.482    0.432
$x = TEST          0.109    0.058          $x = TEST          0.109    0.059
$x = $_GET         0.190    0.138          $x = $_GET         0.188    0.137
$x = $GLOBALS['v'] 0.242    0.191          $x = $GLOBALS['v'] 0.246    0.196
$x = $hash['v']    0.196    0.145          $x = $hash['v']    0.192    0.142
$x = $str[0]       0.146    0.094          $x = $str[0]       0.142    0.092
$x = $a ?: null    0.144    0.093          $x = $a ?: null    0.144    0.094
$x = $f ?: tmp     0.174    0.123          $x = $f ?: tmp     0.174    0.124
$x = $f ? $f : $a  0.153    0.101          $x = $f ? $f : $a  0.153    0.102
$x = $f ? $f : tmp 0.148    0.097          $x = $f ? $f : tmp 0.148    0.098
------------------------                   ------------------------
Total              6.143                   Total              6.108

5 years agospeed up add and sub operators with overflow detection
Sebastian Pop [Thu, 25 Apr 2019 14:44:02 +0000 (14:44 +0000)]
speed up add and sub operators with overflow detection

On A72, google-benchmark measure before and after the patch:
--------------------------------------------------------
Benchmark              Time             CPU   Iterations
--------------------------------------------------------
BM_add_before       13.3 ns         13.3 ns     52626058
BM_sub_before       8.72 ns         8.72 ns     80259343
BM_add_after        4.80 ns         4.80 ns    145926004
BM_sub_after        4.80 ns         4.80 ns    145936496

Before the patch:
fast_long_add_function:
ldr x1, [x1]
ldr x2, [x2]
add x3, x1, x2
eor x4, x1, x2
tbz x4, #63, .L5
.L2:
mov w1, 4
str x3, [x0]
str w1, [x0, 8]
ret
.p2align 2
.L5:
eor x4, x1, x3
tbz x4, #63, .L2
scvtf d0, x1
scvtf d1, x2
mov w1, 5
str w1, [x0, 8]
fadd d0, d0, d1
str d0, [x0]
ret

With the patch:
fast_long_add_function:
ldr    x5, [x1]
ldr    x6, [x2]
adds x5, x5, x6
bvs .L2
mov w6, 4
str x5, [x0]
str w6, [x0, 8]
ret
.L2:
ldr x1, [x1]
mov w3, 5
ldr x2, [x2]
str w3, [x0, 8]
scvtf d0, x1
scvtf d1, x2
fadd d0, d0, d1
str d0, [x0]
ret

    php$ ./sapi/cli/php Zend/bench.php

Base:                         Patch:
simple             0.091      simple             0.091
simplecall         0.014      simplecall         0.014
simpleucall        0.041      simpleucall        0.041
simpleudcall       0.045      simpleudcall       0.045
mandel             0.193      mandel             0.193
mandel2            0.229      mandel2            0.229
ackermann(7)       0.044      ackermann(7)       0.044
ary(50000)         0.010      ary(50000)         0.010
ary2(50000)        0.008      ary2(50000)        0.008
ary3(2000)         0.096      ary3(2000)         0.095
fibo(30)           0.149      fibo(30)           0.148
hash1(50000)       0.016      hash1(50000)       0.016
hash2(500)         0.020      hash2(500)         0.020
heapsort(20000)    0.055      heapsort(20000)    0.054
matrix(20)         0.057      matrix(20)         0.057
nestedloop(12)     0.091      nestedloop(12)     0.091
sieve(30)          0.032      sieve(30)          0.032
strcat(200000)     0.010      strcat(200000)     0.010
------------------------      ------------------------
Total              1.199      Total              1.197

    php$ ./sapi/cli/php Zend/micro_bench.php

Base:                                      Patch:
empty_loop         0.051                   empty_loop         0.051
func()             0.181    0.130          func()             0.181    0.130
undef_func()       0.186    0.135          undef_func()       0.186    0.135
int_func()         0.116    0.064          int_func()         0.116    0.064
$x = self::$x      0.235    0.183          $x = self::$x      0.233    0.182
self::$x = 0       0.198    0.147          self::$x = 0       0.198    0.147
isset(self::$x)    0.229    0.178          isset(self::$x)    0.229    0.178
empty(self::$x)    0.231    0.180          empty(self::$x)    0.231    0.180
$x = Foo::$x       0.144    0.093          $x = Foo::$x       0.144    0.093
Foo::$x = 0        0.107    0.056          Foo::$x = 0        0.107    0.056
isset(Foo::$x)     0.140    0.088          isset(Foo::$x)     0.140    0.088
empty(Foo::$x)     0.148    0.097          empty(Foo::$x)     0.148    0.097
self::f()          0.238    0.187          self::f()          0.238    0.187
Foo::f()           0.209    0.158          Foo::f()           0.209    0.158
$x = $this->x      0.123    0.072          $x = $this->x      0.123    0.072
$this->x = 0       0.124    0.073          $this->x = 0       0.124    0.073
$this->x += 2      0.151    0.099          $this->x += 2      0.153    0.101
++$this->x         0.137    0.086          ++$this->x         0.138    0.086
--$this->x         0.137    0.086          --$this->x         0.138    0.086
$this->x++         0.170    0.119          $this->x++         0.172    0.121
$this->x--         0.171    0.119          $this->x--         0.172    0.121
isset($this->x)    0.170    0.119          isset($this->x)    0.170    0.119
empty($this->x)    0.179    0.128          empty($this->x)    0.179    0.128
$this->f()         0.194    0.143          $this->f()         0.194    0.143
$x = Foo::TEST     0.188    0.137          $x = Foo::TEST     0.188    0.136
new Foo()          0.482    0.431          new Foo()          0.479    0.427
$x = TEST          0.109    0.058          $x = TEST          0.109    0.058
$x = $_GET         0.190    0.138          $x = $_GET         0.190    0.139
$x = $GLOBALS['v'] 0.242    0.191          $x = $GLOBALS['v'] 0.242    0.191
$x = $hash['v']    0.196    0.145          $x = $hash['v']    0.196    0.145
$x = $str[0]       0.146    0.094          $x = $str[0]       0.145    0.094
$x = $a ?: null    0.144    0.093          $x = $a ?: null    0.144    0.093
$x = $f ?: tmp     0.174    0.123          $x = $f ?: tmp     0.174    0.123
$x = $f ? $f : $a  0.153    0.101          $x = $f ? $f : $a  0.153    0.101
$x = $f ? $f : tmp 0.148    0.097          $x = $f ? $f : tmp 0.148    0.097
------------------------                   ------------------------
Total              6.143                   Total              6.143

5 years agoUse PKG_CHECK_MODULES to detect the ffi library
Hugh McMaster [Sun, 5 May 2019 12:25:27 +0000 (22:25 +1000)]
Use PKG_CHECK_MODULES to detect the ffi library

5 years agoDeprecate left-associative ternary
Nikita Popov [Tue, 9 Apr 2019 09:04:13 +0000 (11:04 +0200)]
Deprecate left-associative ternary

Deprecate nesting ternary operators without explicit parentheses.

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

5 years ago[AArch64] use rev64 to reverse strings
Sebastian Pop [Fri, 3 May 2019 15:17:41 +0000 (15:17 +0000)]
[AArch64] use rev64 to reverse strings

The execution time goes from 4.388s down to 0.563s on a Graviton A1
instance for the benchmark:

function reverse_strings() {
    $a = "foo";
    for ($i = 0; $i < 100000; $i++) {
        strrev($a);
        $a .= "o";
    }
}

5 years agoRemove outdated info from README.ZEND_MM
Nikita Popov [Tue, 7 May 2019 07:54:35 +0000 (09:54 +0200)]
Remove outdated info from README.ZEND_MM

[ci skip]

5 years agoConvert CRLF line endings to LF
Peter Kokot [Tue, 7 May 2019 02:40:01 +0000 (04:40 +0200)]
Convert CRLF line endings to LF

This patch simplifies line endings tracked in the Git repository and
syncs them to all include the LF style instead of the CRLF files.

Newline characters:
- LF (\n) (*nix and Mac)
- CRLF (\r\n) (Windows)
- CR (\r) (old Mac, obsolete)

To see which line endings are in the index and in the working copy the
following command can be used:
`git ls-files --eol`

Git additionally provides `.gitattributes` file to specify if some files
need to have specific line endings on all platforms (either CRLF or LF).

Changed files shouldn't cause issues on modern Windows platforms because
also Git can do output conversion is core.autocrlf=true is set on
Windows and use CRLF newlines in all files in the working tree.

Unless CRLF files are tracked specifically, Git by default tracks all
files in the index using LF newlines.

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Peter Kokot [Tue, 7 May 2019 02:35:43 +0000 (04:35 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Convert CRLF line endings to LF

5 years agoConvert CRLF line endings to LF
Peter Kokot [Tue, 7 May 2019 02:34:37 +0000 (04:34 +0200)]
Convert CRLF line endings to LF

This patch simplifies line endings tracked in the Git repository and
syncs them to all include the LF style instead of the CRLF files.

Newline characters:
- LF (\n) (*nix and Mac)
- CRLF (\r\n) (Windows)
- CR (\r) (old Mac, obsolete)

To see which line endings are in the index and in the working copy the
following command can be used:
`git ls-files --eol`

Git additionally provides `.gitattributes` file to specify if some files
need to have specific line endings on all platforms (either CRLF or LF).

Changed files shouldn't cause issues on modern Windows platforms because
also Git can do output conversion is core.autocrlf=true is set on
Windows and use CRLF newlines in all files in the working tree.

Unless CRLF files are tracked specifically, Git by default tracks all
files in the index using LF newlines.

5 years agoRemove empty section
Peter Kokot [Tue, 7 May 2019 02:26:03 +0000 (04:26 +0200)]
Remove empty section

5 years ago[ci skip] Add password registry RFC to changelog
Peter Kokot [Tue, 7 May 2019 00:22:29 +0000 (02:22 +0200)]
[ci skip] Add password registry RFC to changelog

5 years ago[ci skip] Rename libbcmath license file to LICENSE
Peter Kokot [Mon, 6 May 2019 23:09:25 +0000 (01:09 +0200)]
[ci skip] Rename libbcmath license file to LICENSE

- More common filename accross the PHP repository
- Additionally, this patch replaces some legacy form feed (FF or ^L)
  characters (for printers) to LF (\n) newline character.

5 years ago[ci skip] Move OpenLDAP license to redistributable info file
Peter Kokot [Mon, 6 May 2019 21:02:46 +0000 (23:02 +0200)]
[ci skip] Move OpenLDAP license to redistributable info file

5 years agoFix double incremenation in ffi
Peter Kokot [Sun, 5 May 2019 15:51:08 +0000 (17:51 +0200)]
Fix double incremenation in ffi

This removes the warning of:
`incremented both in the loop header and in the loop body` in the
compilation step.

5 years agoRename uppercase JPG file to lowercase jpg
Peter Kokot [Mon, 6 May 2019 03:18:27 +0000 (05:18 +0200)]
Rename uppercase JPG file to lowercase jpg

To not introduce new file type and since it is not related to a test.
Lowercase JPG file type more common and recommended to use.

5 years ago[ci skip] Move wddx to dedicated section
Peter Kokot [Sun, 5 May 2019 22:58:21 +0000 (00:58 +0200)]
[ci skip] Move wddx to dedicated section

5 years agoRemove phpextdist
Peter Kokot [Sat, 4 May 2019 15:57:54 +0000 (17:57 +0200)]
Remove phpextdist

This script hasn't been used since using PEAR as a package manager for
PHP extensions since it is using Makefile.in as an indicator if the
current directory is extension. Instead of this script extensions can
be packaged differently and more properly with either current PEAR
or with some other manual method.

5 years agoRemove duplicate test file
Peter Kokot [Sun, 5 May 2019 22:02:36 +0000 (00:02 +0200)]
Remove duplicate test file

Files ext/oci8/tests/field_funcs0.phpt and
ext/oci8/tests/field_funcs.phpt are the same.

5 years agoRemove duplicate getimagesize_variation_003 test
peter279k [Sun, 5 May 2019 19:00:14 +0000 (03:00 +0800)]
Remove duplicate getimagesize_variation_003 test

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Jakub Zelenka [Sun, 5 May 2019 20:06:30 +0000 (21:06 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

5 years agoMerge branch 'PHP-7.2' into PHP-7.3
Jakub Zelenka [Sun, 5 May 2019 20:05:55 +0000 (21:05 +0100)]
Merge branch 'PHP-7.2' into PHP-7.3

5 years agoFix OpenSSL online test for ca context
Jakub Zelenka [Sun, 5 May 2019 20:04:28 +0000 (21:04 +0100)]
Fix OpenSSL online test for ca context

The php.net is redirected to https so use nginx.org

5 years agoProperly initialize variable
Christoph M. Becker [Sun, 5 May 2019 15:45:16 +0000 (17:45 +0200)]
Properly initialize variable

Not all code paths assign to `handle`, even though it may be used, so
we make sure that it is initialized to a sane value in the first place.

5 years agoFix typo
Christoph M. Becker [Sun, 5 May 2019 13:40:33 +0000 (15:40 +0200)]
Fix typo

5 years agoRe-add common PDO tests to Firebird test suite
Christoph M. Becker [Sat, 4 May 2019 08:46:08 +0000 (10:46 +0200)]
Re-add common PDO tests to Firebird test suite

These have been inadvertently dropped when changing the test suite to
not require ext/interbase anymore, so we add them back.

We also change the required environment variable names to match the
usual PDO names.  Particularly, we replace `PDO_FIREBIRD_TEST_HOSTNAME`
and `_DATABASE` with the more flexible `PDO_FIREBIRD_TEST_DSN`.

5 years agoFix memory leak exhibited by bug_aaa.phpt
Christoph M. Becker [Sat, 4 May 2019 07:42:07 +0000 (09:42 +0200)]
Fix memory leak exhibited by bug_aaa.phpt

Since a statement may be executed multiple times, we need to free
already allocated storage for output data before allocating new
storage.

5 years agoFix undefined variable, and remove unused test-pdo
peter279k [Fri, 3 May 2019 08:22:57 +0000 (16:22 +0800)]
Fix undefined variable, and remove unused test-pdo

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Peter Kokot [Fri, 3 May 2019 15:33:05 +0000 (17:33 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Update `NEWS` with changes made at #4093

5 years agoUpdate `NEWS` with changes made at #4093
Javier Spagnoletti [Fri, 3 May 2019 01:32:37 +0000 (22:32 -0300)]
Update `NEWS` with changes made at #4093

5 years agoFix comment
Christoph M. Becker [Fri, 3 May 2019 14:43:53 +0000 (16:43 +0200)]
Fix comment

0x2d == 45, not 46.  However, `CURLMOPT_PUSHFUNCTION` is actually
available as of cURL 7.44.0[1], while we make the respective PHP
constants available only as of cURL 7.46.0[2].

[1] <https://curl.haxx.se/libcurl/c/CURLMOPT_PUSHFUNCTION.html>
[2] <http://git.php.net/?p=php-src.git;a=blob;f=ext/curl/interface.c;h=fdf855278eef6f32f26c49b54f56aca9bd7007c3;hb=HEAD#l1289>

5 years agoNEWS
Kalle Sommer Nielsen [Thu, 2 May 2019 20:34:46 +0000 (23:34 +0300)]
NEWS

5 years agoInclude the request method in CLI server logs
Simon Welsh [Thu, 2 May 2019 09:58:24 +0000 (19:58 +1000)]
Include the request method in CLI server logs

5 years agoRemove test-pcntl script
peter279k [Thu, 2 May 2019 20:11:44 +0000 (04:11 +0800)]
Remove test-pcntl script

5 years agoPDO_Firebird test update, round 2
Kalle Sommer Nielsen [Thu, 2 May 2019 20:19:27 +0000 (23:19 +0300)]
PDO_Firebird test update, round 2

- This renames the environment variables to: PDO_FIREBIRD_TEST_XXX to be in line with other PDO test suites
- Adds an skipif.inc file that skips the tests if no database is set
- The test suite can now be run without PDO_FIREBIRD_TEST_HOSTNAME

$ set PDO_FIREBIRD_TEST_HOSTNAME=localhost
$ set PDO_FIREBIRD_TEST_DATABASE=C:\dev\php.fdb
$ nmake test TESTS=ext/pdo_firebird/tests

5 years agoRewrite PDO_Firebird tests to not depend on ext/interbase
Kalle Sommer Nielsen [Thu, 2 May 2019 18:48:24 +0000 (21:48 +0300)]
Rewrite PDO_Firebird tests to not depend on ext/interbase

I have no idea how I managed to get this to work, but there is 4 new environment variables that
can be specified for the connection:

- PDO_FIREBIRD_USERNAME
- PDO_FIREBIRD_PASSWORD
- PDO_FIREBIRD_HOSTNAME
- PDO_FIREBIRD_DATABASE

(See testdb.inc for more info)

The only way I could get this to work on my local machine was with a DSN like:

- firebird:dbname=localhost:C:\php.fdb

Hence why the 'hostname' can be specified.

There is also a bit mess in regards to cleanup of this extension tests, but I really do not want to dwell down there, if someone dares to do so, then please be my guest.

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Nikita Popov [Thu, 2 May 2019 13:13:24 +0000 (15:13 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

5 years agoAdd more missing CURL_VERSION_* constants
Javier Spagnoletti [Tue, 30 Apr 2019 17:12:39 +0000 (14:12 -0300)]
Add more missing CURL_VERSION_* constants

And also check for CURL_VERSION_* constants in the sync-constants.php
script.

Related to request #72189: Add missing `CURL_VERSION_*` constants.

5 years agoImplement arrow functions
Nikita Popov [Thu, 2 May 2019 12:57:16 +0000 (14:57 +0200)]
Implement arrow functions

Per RFC: https://wiki.php.net/rfc/arrow_functions_v2

Co-authored-by: Levi Morrison <levim@php.net>
Co-authored-by: Bob Weinand <bobwei9@hotmail.com>
5 years agoRemove some more interbase leftovers
Kalle Sommer Nielsen [Wed, 1 May 2019 20:45:06 +0000 (23:45 +0300)]
Remove some more interbase leftovers

5 years agoFix typo
Kalle Sommer Nielsen [Wed, 1 May 2019 20:38:17 +0000 (23:38 +0300)]
Fix typo

5 years agoNEWS for ext/interbase unbundling
Kalle Sommer Nielsen [Wed, 1 May 2019 20:35:30 +0000 (23:35 +0300)]
NEWS for ext/interbase unbundling

5 years agoMove ext/interbase to pecl/database/interbase
Kalle Sommer Nielsen [Wed, 1 May 2019 20:27:04 +0000 (23:27 +0300)]
Move ext/interbase to pecl/database/interbase

https://wiki.php.net/rfc/deprecate-and-remove-ext-interbase

5 years agoUse ZEND_HASH_FOREACH with direct callback, instead of callbacks
Dmitry Stogov [Tue, 30 Apr 2019 11:50:01 +0000 (14:50 +0300)]
Use ZEND_HASH_FOREACH with direct callback, instead of callbacks

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Tue, 30 Apr 2019 07:36:31 +0000 (09:36 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Update NEWS wrt. sec fixes

5 years agoMerge branch 'PHP-7.2' into PHP-7.3
Christoph M. Becker [Tue, 30 Apr 2019 07:35:12 +0000 (09:35 +0200)]
Merge branch 'PHP-7.2' into PHP-7.3

* PHP-7.2:
  Update NEWS wrt. sec fixes

5 years agoUpdate NEWS wrt. sec fixes
Christoph M. Becker [Tue, 30 Apr 2019 07:34:53 +0000 (09:34 +0200)]
Update NEWS wrt. sec fixes

5 years agofix typo
蝦米 [Tue, 30 Apr 2019 06:40:51 +0000 (14:40 +0800)]
fix typo

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Stanislav Malyshev [Tue, 30 Apr 2019 07:06:10 +0000 (00:06 -0700)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix bug #77950 - Heap-buffer-overflow in _estrndup via exif_process_IFD_TAG

5 years agoMerge branch 'PHP-7.2' into PHP-7.3
Stanislav Malyshev [Tue, 30 Apr 2019 07:05:43 +0000 (00:05 -0700)]
Merge branch 'PHP-7.2' into PHP-7.3

* PHP-7.2:
  Fix bug #77950 - Heap-buffer-overflow in _estrndup via exif_process_IFD_TAG

5 years agoMerge branch 'PHP-7.1' into PHP-7.2
Stanislav Malyshev [Tue, 30 Apr 2019 07:05:32 +0000 (00:05 -0700)]
Merge branch 'PHP-7.1' into PHP-7.2

* PHP-7.1:
  Fix bug #77950 - Heap-buffer-overflow in _estrndup via exif_process_IFD_TAG

5 years agoFix bug #77950 - Heap-buffer-overflow in _estrndup via exif_process_IFD_TAG
Stanislav Malyshev [Tue, 30 Apr 2019 06:38:12 +0000 (23:38 -0700)]
Fix bug #77950 - Heap-buffer-overflow in _estrndup via exif_process_IFD_TAG

I do not completely understand what is going on there, but I am pretty
sure dir_entry <= offset_base if not a normal situation, so we better not
to rely on such dir_entry.

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Stanislav Malyshev [Tue, 30 Apr 2019 05:09:15 +0000 (22:09 -0700)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #77821: Potential heap corruption in TSendMail()

5 years agoMerge branch 'PHP-7.2' into PHP-7.3
Stanislav Malyshev [Tue, 30 Apr 2019 05:09:10 +0000 (22:09 -0700)]
Merge branch 'PHP-7.2' into PHP-7.3

* PHP-7.2:
  Fix #77821: Potential heap corruption in TSendMail()

5 years agoMerge branch 'PHP-7.1' into PHP-7.2
Stanislav Malyshev [Tue, 30 Apr 2019 05:09:04 +0000 (22:09 -0700)]
Merge branch 'PHP-7.1' into PHP-7.2

* PHP-7.1:
  Fix #77821: Potential heap corruption in TSendMail()

5 years agoFix #77821: Potential heap corruption in TSendMail()
Christoph M. Becker [Fri, 29 Mar 2019 10:12:09 +0000 (11:12 +0100)]
Fix #77821: Potential heap corruption in TSendMail()

`zend_string_tolower()` returns a copy (not a duplicate) of the given
string, if it is already in lower case.  In this case we must not not
`zend_string_free()` both strings.  The cleanest solution is to call
` zend_string_release()` on both strings, which properly handles the
refcount.

5 years agoAlso, use ZEND_ACC_PRELOADED for classes
Dmitry Stogov [Mon, 29 Apr 2019 23:07:02 +0000 (02:07 +0300)]
Also, use ZEND_ACC_PRELOADED for classes

5 years agoRemove TSRM configuration header
Peter Kokot [Mon, 29 Apr 2019 20:34:43 +0000 (22:34 +0200)]
Remove TSRM configuration header

TSRM configuration header file was once created by separate autoconf
build system for TSRM and is with the current code not directly needed
like this anymore.

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Mon, 29 Apr 2019 15:24:18 +0000 (17:24 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #77943: imageantialias($image, false); does not work

5 years agoMerge branch 'PHP-7.2' into PHP-7.3
Christoph M. Becker [Mon, 29 Apr 2019 15:23:45 +0000 (17:23 +0200)]
Merge branch 'PHP-7.2' into PHP-7.3

* PHP-7.2:
  Fix #77943: imageantialias($image, false); does not work

5 years agoFix #77943: imageantialias($image, false); does not work
Christoph M. Becker [Mon, 29 Apr 2019 15:23:16 +0000 (17:23 +0200)]
Fix #77943: imageantialias($image, false); does not work

Firstly, we must not call `gdImageSetAntiAliased()` (which sets the
color to anti-alias), but rather modify the `gdImage.AA` flag.
Furthermore, we have to actually use the supplied boolean value.

We also make sure that we don't attempt to enable anti-aliasing for
palette images.

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Mon, 29 Apr 2019 14:29:49 +0000 (16:29 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Add tests for bug77943

5 years agoMerge branch 'PHP-7.2' into PHP-7.3
Christoph M. Becker [Mon, 29 Apr 2019 14:29:29 +0000 (16:29 +0200)]
Merge branch 'PHP-7.2' into PHP-7.3

* PHP-7.2:
  Add tests for bug77943

5 years agoAdd tests for bug77943
Christoph M. Becker [Mon, 29 Apr 2019 14:29:08 +0000 (16:29 +0200)]
Add tests for bug77943

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Mon, 29 Apr 2019 14:18:54 +0000 (16:18 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #77943: imageantialias($image, false); does not work

5 years agoMerge branch 'PHP-7.2' into PHP-7.3
Christoph M. Becker [Mon, 29 Apr 2019 14:17:58 +0000 (16:17 +0200)]
Merge branch 'PHP-7.2' into PHP-7.3

* PHP-7.2:
  Fix #77943: imageantialias($image, false); does not work

5 years agoFix #77943: imageantialias($image, false); does not work
Christoph M. Becker [Mon, 29 Apr 2019 14:14:26 +0000 (16:14 +0200)]
Fix #77943: imageantialias($image, false); does not work

Firstly, we must not call `gdImageSetAntiAliased()` (which sets the
color to anti-alias), but rather modify the `gdImage.AA` flag.
Furthermore, we have to actually use the supplied boolean value.

We also make sure that we don't attempt to enable anti-aliasing for
palette images.

5 years agoAdd UPGRADING entries
Nikita Popov [Mon, 29 Apr 2019 12:17:44 +0000 (14:17 +0200)]
Add UPGRADING entries

5 years agoUse PKG_CHECK_MODULES to detect the zip library
Hugh McMaster [Sat, 27 Apr 2019 08:47:10 +0000 (18:47 +1000)]
Use PKG_CHECK_MODULES to detect the zip library

5 years agoUse PKG_CHECK_MODULES to detect the libsodium library
Hugh McMaster [Wed, 24 Apr 2019 13:27:50 +0000 (23:27 +1000)]
Use PKG_CHECK_MODULES to detect the libsodium library

5 years agoAlways use pkg-config from the host architecture
Hugh McMaster [Wed, 24 Apr 2019 11:39:17 +0000 (21:39 +1000)]
Always use pkg-config from the host architecture

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Nikita Popov [Mon, 29 Apr 2019 11:53:57 +0000 (13:53 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

5 years agoMerge branch 'PHP-7.2' into PHP-7.3
Nikita Popov [Mon, 29 Apr 2019 11:53:21 +0000 (13:53 +0200)]
Merge branch 'PHP-7.2' into PHP-7.3

5 years agoFixed bug #77945
Nikita Popov [Mon, 29 Apr 2019 11:51:26 +0000 (13:51 +0200)]
Fixed bug #77945

Make sure that we proper distinguish between empty string key and
no key during SDL serialization.

5 years agoProperly initialize out parameter
Christoph M. Becker [Mon, 29 Apr 2019 10:17:38 +0000 (12:17 +0200)]
Properly initialize out parameter

The MS docs on `SQLColAttribute()`[1] state regarding the
`NumericAttributePtr` parameter:

| Please note that some drivers may only write the lower 32-bit or
| 16-bit of a buffer and leave the higher-order bit unchanged.
| Therefore, applications should initialize the value to 0 before
| calling this function.

[1] <https://docs.microsoft.com/en-us/sql/odbc/reference/syntax/sqlcolattribute-function?view=sql-server-2017>

5 years agoAdds json_encode test for unpacked arrays
Jury [Mon, 29 Apr 2019 02:58:11 +0000 (22:58 -0400)]
Adds json_encode test for unpacked arrays

5 years agoExtend CURLFile to support streams
Christoph M. Becker [Mon, 29 Apr 2019 08:21:07 +0000 (10:21 +0200)]
Extend CURLFile to support streams

Due to former restrictions of the libcurl API, curl multipart/formdata
file uploads supported only proper files.  However, as of curl 7.56.0
the new `curl_mime_*()` API is available (and already supported by
PHP[1]), which allows us to support arbitrary *seekable* streams, which
is generally desirable, and particularly resolves issues with the
transparent Unicode and long part support on Windows (see bug #77711).

Note that older curl versions are still supported, but CURLFile is
still restricted to proper files in this case.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=a83b68ba56714bfa06737a61af795460caa4a105>

5 years agoFix typo in TRY_ASSIGN macro name
Nikita Popov [Mon, 29 Apr 2019 07:58:45 +0000 (09:58 +0200)]
Fix typo in TRY_ASSIGN macro name

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Mon, 29 Apr 2019 07:07:13 +0000 (09:07 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix tests

5 years agoMerge branch 'PHP-7.2' into PHP-7.3
Christoph M. Becker [Mon, 29 Apr 2019 07:05:04 +0000 (09:05 +0200)]
Merge branch 'PHP-7.2' into PHP-7.3

* PHP-7.2:
  Fix tests