Commit Graph

12125 Commits

Author SHA1 Message Date
Nikita Popov
46faf8f018 Introduce zend_stream_init_fp() API
Reduce the amount of code that mucks around with zend_file_handle
initialization.
2019-07-16 16:44:37 +02:00
Nikita Popov
26977fdfdd Fix name collisions in fputcsv tests 2019-07-16 10:25:06 +02:00
Remi Collet
a7ff3a6483 Fix #78269 password_hash uses weak options for argon2 2019-07-15 14:11:30 +02:00
Remi Collet
eab0079c90 Fix #78269 password_hash uses weak options for argon2 2019-07-15 14:10:38 +02:00
Sebastian Pop
af7639683f vectorize string-escape with NEON
On this benchmark:
function simple_string_escape() {
    $a = "test'asd'asd'' asd\'\"asdfasdf";
    for($i=0; $i<512; $i++) {
        $a .= chr($i%256);
    }
    for ($i = 0; $i < 100000; $i++) {
        if ($a === stripslashes(addslashes($a)))
            $a .= chr($i%256);
        else {
            echo "error at i=".$i."\n";
            return;
        }
    }
}
the execution time goes from 21.619s to 8.139s (165% speedup) on an A1 Graviton instance.

When removing the characters that need escaping, i.e., this benchmark:
function simple_string() {
  $a = "testasdasd asdasdfasdf";
  for ($i = 0; $i < 10000; $i++) {
      if ($a === stripslashes(addslashes($a)))
          $a .= "test dedeasdf";
      else {
          echo "error at i=".$i."\n";
          return;
      }
  }
}
the execution time goes from 2.932s down to 0.516s (468% speedup) on an A1 Graviton instance.
2019-07-15 11:35:08 +03:00
Peter Kokot
f3cf8966be Remove unused recode extension artefacts
Closes GH-4395
2019-07-13 14:52:36 +02:00
Peter Kokot
f5e4771824 Remove checks for always enabled spl and pcre
Closes GH-4397
2019-07-13 14:47:37 +02:00
Christoph M. Becker
8c76d898a9 Fix #78283: no output for explicit environment
This test does not work on Windows, if the child process has OPcache
enabled via php.ini, since TEMP is not set in the environment, so
OPcache can't find the base address file, and terminates the childs.

To avoid this (and potentially some other issues regarding missing
environment variables, such as PATH), we force the child process to
ignore any ini files.
2019-07-13 12:03:03 +02:00
George Peter Banyard
1c1de0c41a Convert all php_error_docref0 to php_error_docref
Closes GH-4394
2019-07-13 02:05:17 +02:00
Christoph M. Becker
8aa7865997 Swap implode() argument order in the test helper 2019-07-12 13:26:54 +02:00
Nikita Popov
94d37a5dd7 Remove unnecessary uses of allow_url_include in tests 2019-07-12 12:54:34 +02:00
Nikita Popov
9345c191db Remove unnecessary uses of restore_include_path() in tests 2019-07-12 12:54:26 +02:00
Christoph M. Becker
d0d02ecc4e Revert "Temporarily skip test"
This reverts commit 4e5a717866.

As of commit 17f7fb7605 the test should
no longer hang.
2019-07-11 23:33:34 +02:00
Nikita Popov
59852c0321 Remove redundant 64-bit ezmlm_hash() test
This test is the same as the as ezmlm_hash_basic.phpt. This function
does not behave differently on 32-bit and 64-bit.
2019-07-11 17:09:18 +02:00
Nikita Popov
6285bb52fa Support redirect+null descriptors in proc_open
This adds support for doing something like:

    [1 => ['pipe', 'w'], 2 => ['redirect', 1]]

This will make descriptor 2 on the child end a dup'd descriptor 1.
This is mainly useful in conjunction with shell-less mode, because
we don't have an easy way to do "2>&1" there.

Additionally we support:

    [1 => ['pipe', 'w'], 2 => ['null']]

Which would be the same as a >/dev/null or >nul redirect, depending
on platform.
2019-07-11 15:48:10 +02:00
Nikita Popov
d20fc5a192 Make proc_open_bug64438.phpt more robust
The test currently assumes that we'll first read the data of
stdout and stderr and then see eof on stdout and stderr. However
we could also read stdout, see eof on stdout, read stderr and see
eof on stderr, depending on timing.

Avoid output ordering issues by collecting events into a per-pipe
array, so interleaving is not visible.
2019-07-11 12:46:56 +02:00
Sebastian Pop
3b73c9fb86 neon vectorization for base64
A similar algorithm is used to vectorize on x86_64, with a good description in
https://arxiv.org/abs/1704.00605 . On AArch64 the implementation differs in that
instead of using multiplies to shift bits around, it uses the vld3+vst4 and
vld4+vst3 combinations to load and store interleaved data.  This patch is based
on the NEON implementation of Wojciech Mula:
https://github.com/WojciechMula/base64simd/blob/master/encode/encode.neon.cpp
https://github.com/WojciechMula/base64simd/blob/master/encode/lookup.neon.cpp
and
https://github.com/WojciechMula/base64simd/blob/master/encode/encode.neon.cpp
https://github.com/WojciechMula/base64simd/blob/master/encode/encode.neon.cpp
adapted to php/ext/standard/base64.c and vectorized with factor 16 instead of 8.

On a Graviton A1 instance and on the synthetic benchmarks in
https://github.com/lemire/fastbase64 I see 175% speedup on base64 encoding and
60% speedup on base64 decode compared to the scalar implementation.

The patch passes `make test` regression testing on aarch64-linux.
2019-07-11 12:04:29 +03:00
Sebastian Pop
2a535a9707 [AArch64] Use crc32 instructions when available
The time goes from 0.838s down to 0.029s (a 28x speedup) on a Graviton A1
instance and the following benchmark:

function simple_crc32() {
  $a = "foo";
  for ($i = 0; $i < 10000; $i++) {
      crc32($a);
      $a .= "o".$i;
  }
}
2019-07-11 10:29:45 +02:00
Nikita Popov
c42b7dd6d3 Throw notice on array access on illegal type
No notice is thrown for list() accesses, because we did not come
to an agreement regarding patterns like

    while ([$key, $value] = yield $it->next()) { ... }

where silent null access may be desirable.

No effort is made to suppress multiple notices in access chains
likes $x[0][0][0], because the technical complexity this causes
does not seem worthwhile.

RFC: https://wiki.php.net/rfc/notice-for-non-valid-array-container
2019-07-10 12:02:14 +02:00
Nikita Popov
0c450967e1 Simplify two unserialize() tests
unserialize() returns false for these now, so it doesn't make sense
to try and do something with the result.
2019-07-10 11:09:54 +02:00
Remi Collet
db0eaa8cf1 improve libargon2/libsodium compatibility 2019-07-10 09:00:41 +02:00
Sara Golemon
f65956e4fb
Relax argon2 mem_cost down to 64k, bump time_cost to 4 2019-07-09 11:36:48 -04:00
Peter Kokot
4b864c2ebb Remove APACHE symbol
The APACHE symbol was used in very early PHP versions to indicate the
Apache module usage. Since PHP 4 this is no longer used in the code.
2019-07-08 15:05:54 +02:00
Scott Dutton
d90cdbd9df Deprecate passing invalid character to base_convert etc
RFC: https://wiki.php.net/rfc/base_convert_improvements
2019-07-08 12:49:21 +02:00
Sara Golemon
0ba1db7a4a Provide argon2i(d) password hashing from sodium when needed 2019-07-07 21:53:43 -04:00
Christoph M. Becker
30441e65dd Remove superfluous assignment 2019-07-05 15:56:26 +02:00
Christoph M. Becker
4e5a717866 Temporarily skip test
This test hangs on Windows for ~10 minutes as of commit 30019f4, so we
temporarily skip it.  The issue will be investigated by Joe and myself
in due course.
2019-07-05 12:48:10 +02:00
Nikita Popov
ea86a9209c Optimize integer in_array with strict=true
It doesn't make sense that using in_array with strict=false is
much faster for this case, due to lack of a specialized codepath.
2019-07-05 11:20:29 +02:00
Nikita Popov
6dd4cccef8 Fix file conflict in fgets test 2019-07-03 11:27:02 +02:00
Christoph M. Becker
b4c81be9c5 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78241: touch() does not handle dates after 2038 in PHP 64-bit
2019-07-03 10:03:14 +02:00
Christoph M. Becker
5e5b7cb4d4 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #78241: touch() does not handle dates after 2038 in PHP 64-bit
2019-07-03 10:02:22 +02:00
Christoph M. Becker
44c8b7414c Fix #78241: touch() does not handle dates after 2038 in PHP 64-bit
`time_t` defaults to `_time64` (which is 64bit signed) even on x86, but
`Int32x32To64()` truncates it to signed 32bit.  We replace the macro
with the "manual" calculation.
2019-07-03 09:59:17 +02:00
Nikita Popov
1e06a8ef95 Update proto comment for proc_open 2019-07-02 10:10:51 +02:00
Nikita Popov
83ee7b4c07 Run file_put_contents_variantion8 in separate directory
There are other tests that try to read these files.
2019-07-01 11:54:05 +02:00
Nikita Popov
7e6db70064 Msan: Unpoison getrandom() syscall result 2019-07-01 11:14:17 +02:00
Nikita Popov
5c0a9a4096 Add some tolerance to time_sleep_until() test
This has been sporadically failing on macos for a while. We've tried
a couple of things (using int arithmetic, normalizing to gettimeofday),
but this issue remains. I'm adding some tolerance to the test to
avoid CI failures.
2019-07-01 09:43:16 +02:00
Peter Kokot
9a3c8e51e3 Sync functions checks
Removed unused checks:
- mbsinit check removed, HAVE_MBSINIT removed (not used in php-src)
- mempcpy check removed, HAVE_MEMPCPY removed (not used in php-src anymore since
  560ed89bfb which uses PHP's own implementation)
- strpncpy check removed, added via a8c9e893b6 and
  not used.
- setpgid check removed since HAVE_SETPGID is not used

Moved to a central configure.ac:
- fpclass
- mbrlen moved to configure.ac (since the HAVE_MBRLEN is used accross the php-src)
- sigprocmask
- getcwd
- getwd
- glob
- strfmon
- nice

Duplicated checks removed:
- gethostname
- getlogin
- getpwuid_r
- socketpair

- mprotect check simplified
2019-06-30 23:57:54 +02:00
Peter Kokot
778f08ff06 Fix missing file and remove SKIP section
Test now passes on VC 14, 15 and 16 with current MSVC runtimes.
2019-06-30 23:50:09 +02:00
Peter Kokot
57424f272c Clean up files after the tests are run 2019-06-28 20:19:00 +02:00
Nikita Popov
88d52ae7aa Mark ifunc resolver functions as unused
It looks like clang doesn't see that these are used through
__attribute__((ifunc)) and generates a warning.
2019-06-28 16:55:54 +02:00
Nikita Popov
54dd762f59 Set up asan+ubsan scheduled build on azure
Also adds an --asan flag to run-tests.php to setup all the necessary
environment variables. Some tests are marked as skipped because they
are incompatible with asan or too slow.

I'm basing this on the DEBUG_ZTS build, which seems to give us the
most mileage.
2019-06-28 15:00:54 +02:00
Nikita Popov
8be051015e Add support for proc_open() with a command array
In this case the progarm will be executed directly, without a shell.
On Linux the arguments are passed directly to execvp and no escaping
is necessary. On Windows we construct a command string using escaping
with the default Windows command-line argument parsing method described
at https://docs.microsoft.com/en-us/cpp/cpp/parsing-cpp-command-line-arguments.

Apart from avoiding the issue of argument escaping, passing an array
and bypassing shell has the advantage of allowing proper signal
delivery to the opened process (rather than the shell).
2019-06-28 11:09:55 +02:00
Sara Golemon
27f1f3ed1a Bugfix #78208 Needs rehash with an unknown algo should always return true. 2019-06-27 19:26:03 -04:00
Peter Kokot
638c21765c Remove HAVE_STRCOLL check
The strcoll function is defined in the C89 standard and should be
on today's systems always available via the <string.h> header.

https://port70.net/~nsz/c/c89/c89-draft.html#4.11.4.3

- Remove also SKIPIF strcoll check in test
2019-06-28 00:05:55 +02:00
Peter Kokot
2079b09854 Clean headers checks
Some headers were checked multiple times in the main configure.ac file
and in the bundled extensions or SAPIs themselves. Also many of these
checks are then used accross other extensions or SAPIs so a central
configure.ac makes most sense for these checks.
2019-06-27 02:45:09 +02:00
Christoph M. Becker
801ab18ea7 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Remove stream_socket_sendto.phpt
2019-06-26 17:01:29 +02:00
Nikita Popov
7d28a24c66 Remove stream_socket_sendto.phpt
Fails for me locally due to different number of warnings with
different messages. Rather than adding more wildcards I'm dropping
this test entirely, as it doesn't seem to test anything particularly
useful.

(cherry picked from commit 84333cad67)
2019-06-26 16:58:37 +02:00
Nikita Popov
df27bfe58b Add debugging code to time_sleep_until test 2019-06-22 10:19:49 +02:00
Nikita Popov
1de7c4b919 Fix memory leaks in browscap parsing
Also make the interning a bit more efficient, no need to check for
a "real" interned string every time, we can also store that in the
HT.
2019-06-21 12:56:37 +02:00
Nikita Popov
59974000eb Remove leftover check
This is checked below now in a way that handles misaligned pointers.
2019-06-20 17:24:22 +02:00
Nikita Popov
26ac6cb6be Handle gethostbyname misalignment on macos 2019-06-20 16:22:40 +02:00
Nikita Popov
d4de127dd8 In php_needle_char() use well-defined double->integer cast
...by going through zval_get_long(). Generally out of range double
casts are undefined.
2019-06-20 16:22:10 +02:00
Nikita Popov
e8ae19223c Avoid address calculation overflow 2019-06-20 16:22:04 +02:00
Nikita Popov
4ae87f4bf9 Fix overflow UB in range() 2019-06-19 15:09:00 +02:00
Nikita Popov
8740533ddf Avoid more UB in round() 2019-06-19 15:09:00 +02:00
Nikita Popov
4b5e824aae Use unsigned char in _crypt_extended_r
Avoid signed shift UB.
2019-06-19 15:09:00 +02:00
Nikita Popov
bee7973e52 Use unsigned chars in php_uuencode()
Avoid shift UB on signed integers.
2019-06-19 15:09:00 +02:00
Nikita Popov
0c0659dc50 Fix _php_math_round UB
php_intlog10abs() is ill-defined for a zero value. Avoid calling it
altogether as there's nothing to round with a zero value.
2019-06-19 15:09:00 +02:00
Nikita Popov
317dfab81b Fix memcpy null arg UB 2019-06-19 15:09:00 +02:00
Joe Watkins
11f30d67ea
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  fix setcookie Max-Age to use php_time
2019-06-19 12:43:17 +02:00
Joe Watkins
a5db319463
Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  fix setcookie Max-Age to use php_time
2019-06-19 12:42:25 +02:00
Joe Watkins
31a1c1e67c
fix setcookie Max-Age to use php_time 2019-06-19 12:42:00 +02:00
Nikita Popov
d924b426c9 Fix file clash in fgetcsv test 2019-06-17 17:25:43 +02:00
Christoph M. Becker
e58e2fd0d4 Improve create_verify_dir() diagnostics
If create_verify_dir() fails[1], we need more info why that happened.

[1] <https://ci.appveyor.com/project/cmb69/php-src/builds/25324138/job/dm1n12gqhdqa3ln5#L5753>
2019-06-17 16:49:52 +02:00
Nikita Popov
4befe320e3
Use uint64_t for time_sleep_until calculations 2019-06-16 19:20:08 +02:00
Christoph M. Becker
11c3215251 Prevent parallel test conflict
Cf. <https://travis-ci.org/php/php-src/jobs/546112543#L2865-L2866>.
2019-06-16 11:48:48 +02:00
Joe Watkins
7e1972796b
gettimeofday cannot be used to reliably implement high precision process synchronization
The use of gettimeofday in time_sleep_until is technically incorrect, it's not possible
to use gettimeofday in this way reliably on any platform: It relies on operating system
global structures, which may be modified by any other process on the system at any time.

While in practice, users may be ignoring this flaw, it entirely depends on the other software
running on the system to which the application is deployed, there is no possible way to write
a test that will always pass on any system, therefore it must be marked XFAIL.
2019-06-16 07:02:28 +02:00
Joe Watkins
3852a35fdb
This test is flaky, and some of it doesn't make sense.
I've refactored based on the original bug report, related bugs, and commits
to php-src that were related to them.

It is supposed to be testing windows specific behaviour related to non-blocking pipes,
nevertheless the test runs everywhere.
2019-06-15 09:57:51 +02:00
Nikita Popov
7410155dab Remove file/005_variation.phpt
As this test doesn't check differences in times before and after
operations, it doesn't actually verify anything and just wastes
30 seconds of test time.

As we already have other tests that do check how stat times change,
I'm removing it entirely.
2019-06-14 17:06:47 +02:00
Joe Watkins
f16b012116
fix mac tests on azure 2019-06-14 12:55:00 +02:00
Nikita Popov
19e2101dfa Revert "ext/standard: Use PKG_CHECK_MODULES to detect the Argon2 library"
This reverts commit bdcef51bcb.

It seems that pkg-config support for libargon2 is still flaky:
 * No pc file on Alpine.
 * Custom builds of released libargon2 versions create a broken
   pc file. This is fixed in master, but not released.

Go back to the old detection code for now.
2019-06-13 16:53:05 +02:00
Nikita Popov
6fcb469991 Fix unsigned char mismatch 2019-06-12 14:58:06 +02:00
Derick Rethans
ec57ba5edd Update CREDITS for PHP 7.4.0alpha1 2019-06-12 12:24:35 +01:00
Nikita Popov
fdfb390f07 Remove unused php_mbX_int_to_char() functions 2019-06-12 13:17:25 +02:00
Nikita Popov
5be772a19c Fix incorrect printf modifiers 2019-06-12 13:17:25 +02:00
Derick Rethans
06ddc025ac Update credits pre-release 2019-06-12 08:58:11 +01:00
Nikita Popov
b654a07492 Revert option rename
Let's keep this at --with-password-argon2 to avoid churn, I don't
think we have a strong motivation to rename this one.
2019-06-12 09:28:25 +02:00
Hugh McMaster
bdcef51bcb
ext/standard: Use PKG_CHECK_MODULES to detect the Argon2 library 2019-06-12 06:54:54 +02:00
George Peter Banyard
7f5f277cf2 Remove unnecessary short_open_tag INI directive in tests
Closes GH-4249.
2019-06-11 16:14:10 +02:00
Christoph M. Becker
27e592d3ce Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #77937: preg_match failed
2019-06-11 08:44:54 +02:00
Christoph M. Becker
b215d1339f Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #77937: preg_match failed
2019-06-11 08:44:07 +02:00
Christoph M. Becker
f3ff72e54b Fix #77937: preg_match failed
On some recent Windows systems, ext\pcre\tests\locales.phpt fails,
because 'pt_PT' is accepted by `setlocale()`, but not properly
supported by the ctype functions, which are used internally by PCRE2 to
build the localized character tables.

Since there appears to be no way to properly check whether a given
locale is fully supported, but we want to minimize BC impact, we filter
out typical Unix locale names, except for a few cases which have
already been properly supported on Windows.  This way code like

  setlocale(LC_ALL, 'de_DE.UTF-8', 'de_DE', 'German_Germany.1252');

should work like on older Windows systems.

It should be noted that the locale names causing trouble are not (yet)
documented as valid names anyway, see
<https://docs.microsoft.com/en-us/cpp/c-runtime-library/locale-names-languages-and-country-region-strings?view=vs-2019>.
2019-06-11 08:42:32 +02:00
Dmitry Stogov
8fbfd8872a Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #77135 (Extract with EXTR_SKIP should skip $this)
2019-06-07 11:50:19 +03:00
Dmitry Stogov
972223c342 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed bug #77135 (Extract with EXTR_SKIP should skip $this)
2019-06-07 11:48:57 +03:00
Dmitry Stogov
83cdb89f8a Fixed bug #77135 (Extract with EXTR_SKIP should skip $this) 2019-06-07 11:36:39 +03:00
Dmitry Stogov
457392fa64 Cheaper checks for exceptions thrown from __toString() 2019-06-06 01:47:22 +03:00
Joe Watkins
6f9a06cb74
this test is flaky on azure, and can't see why from current output
so refactored, and restored an accidentally removed check (resource)
2019-06-05 19:24:41 +02:00
Nikita Popov
a31f46421d Allow exceptions in __toString()
RFC: https://wiki.php.net/rfc/tostring_exceptions

And convert some object to string conversion related recoverable
fatal errors into Error exceptions.

Improve exception safety of internal code performing string
conversions.
2019-06-05 14:25:07 +02:00
Remi Collet
a0ce1df024 ignore first gets time which is usually a few ms only
in previous version, max_ms was "1" and "10" in travis/appveyor
having 10 by default make it fails on fast computer
2019-06-05 11:48:48 +02:00
Nikita Popov
84333cad67 Remove stream_socket_sendto.phpt
Fails for me locally due to different number of warnings with
different messages. Rather than adding more wildcards I'm dropping
this test entirely, as it doesn't seem to test anything particularly
useful.
2019-05-31 11:09:56 +02:00
Dmitry Stogov
83804519df Replace ZVAL_COPY() and ZVAL_COPY_VALUE() for IS_OBJECT by cheaper macros 2019-05-28 20:10:02 +03:00
Dmitry Stogov
b2cb6a4a27 Avoid double copying 2019-05-28 13:35:00 +03:00
Dik Takken
77cf3d7b11 Allow array_merge() / array_merge_recursive() without arguments
This allows writing

    array_merge(...$arrays)

instead of

    array_merge([], ...$arrays)

and is in line with similar changes to array_push() and array_unshift()
in PHP 7.3.

Closes GH-4175.
2019-05-28 11:14:15 +02:00
Dmitry Stogov
072f28938f Put phpinfo() related code into cold code segment 2019-05-28 11:04:13 +03:00
Gabriel Caruso
4bb6f9ba99 Make more tests run on Windows 2019-05-27 10:51:53 +02:00
David Carlier
d9747c23a2 list net/interfaces, trying to get the error on windows when possible 2019-05-24 10:22:39 +02:00
Christoph M. Becker
c70975e0a5 Prevent further potential test conflicts
These tests partially use the same resource names; as a quick-fix we're
marking them all as conflicting.
2019-05-23 13:14:04 +02:00
Christoph M. Becker
ced8760ca8 Prevent potential test conflict
bug48746_tmp.lnk is also created by bug48746_2.phpt which might clash,
if both are run simultaneouly.
2019-05-23 11:40:39 +02:00
Christoph M. Becker
c982a4c3f9 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  use {TMP} placeholder in phpt tests
2019-05-21 09:03:20 +02:00
Christoph M. Becker
11740abd6b Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  use {TMP} placeholder in phpt tests
2019-05-21 09:03:01 +02:00
Holly Li (WIPRO LIMITED)
202e6936d6 use {TMP} placeholder in phpt tests 2019-05-21 09:02:37 +02:00
Gabriel Caruso
714d9fc358 Make chr ZPP failure message consistent with ext/standard 2019-05-18 15:59:07 -03:00
Peter Kokot
ab2710c8d0 Rename *.tif to *.tiff for consistency
There really isn't any practical difference between these two, but repo
currently uses *.tiff files more than 8.3 variant filenames of *.tif.
Also these aren't part of the test.
2019-05-16 07:41:45 +02:00
Peter Kokot
f1a53501e6 Rename *.dat to *.data for common file type
File extension in this case is not part of the test.
2019-05-14 23:31:42 +02:00
Nikita Popov
3f19f5112a Add RETURN_EMPTY_ARRAY() / RETVAL_EMPTY_ARRAY()
The usual wrappers around ZVAL_EMPTY_ARRAY()...
2019-05-14 14:59:10 +02:00
Christoph M. Becker
2e8518fdcf Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78003: strip_tags output change since PHP 7.3
2019-05-13 13:11:07 +02:00
Christoph M. Becker
69bab6e5a5 Fix #78003: strip_tags output change since PHP 7.3
A refactoring of the strip tags state machine[1] missed the special
treatment of `depth > 0` when a `>` is encountered in state 2 or 3.  We
re-add it for BC reasons.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=5cf64742773ddbf9af69d962a4d12b567fcf0084>
2019-05-13 13:10:24 +02:00
Peter Kokot
75fb74860d Normalize comments in *nix build system m4 files
Normalization include:
- Use dnl for everything that can be ommitted when configure is built in
  favor of the shell comment character # which is visible in the output.
- Line length normalized to 80 columns
- Dots for most of the one line sentences
- Macro definitions include similar pattern header comments now
2019-05-12 18:43:03 +02:00
David Carlier
1f3f54f586 list interfaces/adding just "binary" state status. 2019-05-11 20:29:09 +02:00
Christoph M. Becker
330d773b3c Prevent race condition
This test may conflict with readdir_variation3.phpt otherwise.
2019-05-11 09:52:19 +02:00
Sebastian Pop
68a7578243 [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";
    }
}
2019-05-07 10:40:45 +02:00
Peter Kokot
b8caba92e2 Remove empty section 2019-05-07 04:26:03 +02:00
peter279k
8417142a8f Remove duplicate getimagesize_variation_003 test 2019-05-05 23:55:09 +02:00
Kalle Sommer Nielsen
b458fcb87f Move ext/interbase to pecl/database/interbase
https://wiki.php.net/rfc/deprecate-and-remove-ext-interbase
2019-05-01 23:27:04 +03:00
codarrenvelvindron
5c05f5e6d3 Added tls 1.3 support for PHP 2019-04-28 17:37:43 +01:00
Christoph M. Becker
09345d70fd Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #77940: test using outdated mon_thousands_sep for Swedish
2019-04-25 23:29:25 +02:00
Christoph M. Becker
70239ea1d3 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #77940: test using outdated mon_thousands_sep for Swedish
2019-04-25 23:29:03 +02:00
Christoph M. Becker
7ddfe73e69 Fix #77940: test using outdated mon_thousands_sep for Swedish
Of course, we should expect a comma, not a period.
2019-04-25 23:28:41 +02:00
Christoph M. Becker
f532618776 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #77940: test using outdated mon_thousands_sep for Swedish
2019-04-25 19:40:37 +02:00
Christoph M. Becker
3e31ae5d70 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #77940: test using outdated mon_thousands_sep for Swedish
2019-04-25 19:40:05 +02:00
Christoph M. Becker
bfbfb9dabd Fix #77940: test using outdated mon_thousands_sep for Swedish
This time so that it works for all Windows 10 versions (hopefully).
2019-04-25 19:39:42 +02:00
Christoph M. Becker
627c0017b0 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #77940: test using outdated mon_thousands_sep for Swedish
2019-04-25 08:59:35 +02:00
Christoph M. Becker
dcba479848 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #77940: test using outdated mon_thousands_sep for Swedish
2019-04-25 08:59:09 +02:00
Christoph M. Becker
37ca6a7a2a Fix #77940: test using outdated mon_thousands_sep for Swedish 2019-04-25 08:58:13 +02:00
Christoph M. Becker
6dbb1d9318 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #77938: socket_get_option error
2019-04-25 00:06:15 +02:00
Christoph M. Becker
ad0acc0aa9 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #77938: socket_get_option error
2019-04-25 00:04:37 +02:00
Christoph M. Becker
fe202d99c8 Fix #77938: socket_get_option error
Since tcp_socket/ssl streams are not representable, we suppress the
redirect to fix the test case.
2019-04-25 00:03:45 +02:00
Dmitry Stogov
9e9407c22e settype() optimization 2019-04-24 22:23:49 +03:00
Dmitry Stogov
e188e4170f Use ZEND_TRY_ASSIGN_REF_... macros for arguments passed to internal function by reference 2019-04-24 18:28:29 +03:00
Nikita Popov
a7a318d3c0 Merge branch 'PHP-7.3' into PHP-7.4 2019-04-23 11:40:43 +02:00
Nikita Popov
cedee4408b Fixed bug #77931 2019-04-23 11:40:13 +02:00
Christoph M. Becker
808eaa095e Merge link.c and link_win32.c 2019-04-22 13:53:17 +02:00
Christoph M. Becker
6710929c04 Fix parameter order
The parameter order of `php_sys_link()` should be identical on Windows
and POSIX, bug commit c9861bd[1] got that wrong.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=c9861bd7a974ef1555395b879c1035a0bbc12ef1>
2019-04-22 12:38:24 +02:00
Nikita Popov
487d4d07b4 Remove some uses of deprecated internal_encoding settings in tests 2019-04-17 14:24:11 +02:00
Nikita Popov
2bdd212887 Merge branch 'PHP-7.3' into PHP-7.4 2019-04-16 12:21:16 +02:00
Nikita Popov
f9a755d0d2 Fix HT flags copying wrt iterator count
HT_FLAGS() includes the full flag word, including the iterator
count. When we're fully reassigning it, we need to make sure that
we either really do want to copy the iterator count (as in some
cases in array.c) or we need to mask only the actual flag byte.

Add an assert to hash_iterators_del() to make sure the iterator
count is non-zero (which is how I ran into this) and make sure that
the iterator count is correctly preserved during array splicing.
2019-04-16 12:14:45 +02:00
Nikita Popov
433d68fce1 Try to fix stat_variation3-win32.phpt
After fixing comparison operator typos in
f73c104927 this test is failing. I
believe the comparison here should be using < rather than ==.
2019-04-15 11:40:37 +02:00
Nikita Popov
7f6c22cb3d Fix last maybe uninit warnings on 7.4
Most of these only occur under GCC 5. Not fond of all the workarounds
(especially the PDO one), but it gets us a clean build...
2019-04-15 11:35:13 +02:00
Nikita Popov
f73c104927 Fix incorrect compare_stats operator 2019-04-15 09:48:39 +02:00
Nikita Popov
b6b98bdf64 Avoid uninit warnin in http_fopen_wrapper
This one looks semi-legit, in case php_stream_eof() returns false
but php_stream_get_line() fails. Not totally sure this cannot
happen, so rewriting to check both conditions at once.
2019-04-12 15:12:39 +02:00
Nikita Popov
339b0af429 Avoid misc uninitialized variable warnings 2019-04-12 15:12:39 +02:00
Nikita Popov
733c61a894 Add test for get_cfg_var with array variable
And fix incorrect variable shadowing in add_config_entry(). However,
the test doesn't hit this case, as it requires a nested array. I'm
not sure if it's possible to produce nested arrays from ini?
2019-04-12 15:12:39 +02:00
Nikita Popov
0774d67ff9 Avoid directory clash in realpath tests 2019-04-12 09:57:07 +02:00
Nikita Popov
e2ea0f105c Fix bug #77866: Port Serializable SPL classes to use __unserialize()
Payloads created using Serializable are still supported.
2019-04-10 09:36:39 +02:00
Nikita Popov
cb145e18b2 Fixed bug #77873 2019-04-09 17:27:02 +02:00
Nikita Popov
b870685c5b Fix leak on error in new serialization mechanism 2019-04-09 17:19:44 +02:00
Peter Kokot
e6a6017f78 Remove HAVE_STRERROR
Checking for the strerror function presence is no longer needed since it
is part of the C89 standard [1] and can be safely assumed that all
current systems have it.

Check in the configure.ac and Windows defined symbol are still left
until the file library (libmagic) will be updated.

[1]: https://port70.net/~nsz/c/c89/c89-draft.html
2019-04-08 23:39:45 +02:00
Nikita Popov
897cb8bc6f Merge branch 'PHP-7.3' into PHP-7.4 2019-04-08 13:00:20 +02:00
Nikita Popov
a90ac8b5b2 Merge branch 'PHP-7.2' into PHP-7.3 2019-04-08 13:00:05 +02:00
twosee
bdac9ef10d Preserve keys in emulate_read_fd_set()
Keys are already preserved in the non-emulated case.
2019-04-08 12:58:46 +02:00