13602 Commits
Author SHA1 Message Date
Christoph M. Becker 8a8e307cd5 Mark slow tests
Each of these tests took more than ten seconds on a recent AppVeyor CI
run; that appears to qualify them to be marked as slow tests.

Closes GH-7077.
2021-06-03 15:14:08 +02:00
George Peter BanyardandNikita Popov b6958bb847 Implement "Deprecate implicit non-integer-compatible float to int conversions" RFC. (#6661)
RFC: https://wiki.php.net/rfc/implicit-float-int-deprecate

Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
2021-05-31 15:48:45 +01:00
Peter van Dommelen 3a4ea6cb91 Don't automatically adjust memory_limit to 2M
As PHP has a minimum memory usage of 2M (size of allocator chunk),
setting a limit below that value is not meaningful and will be
automatically rounded up to the chunk size. Rather than doing this
silently, show the newly introduced error message.

The memory limit had to be increased to 2M for a number of tests.

tests/lang/bug45392 has been marked as XFAIL. This old bugfix is
not working as intended. The memory limit in main's `PG(memory_limit)`
differs from the one in zend_alloc. In zend_alloc the `AG(mm_heap)->limit`
is defined as `max(passed_value, ZEND_MM_CHUNK_SIZE)`. The check made in
an unclean shutdown will never be true unless the memory limit is lower
than ZEND_MM_CHUNK_SIZE, which happened to be the case in the test.
https://bugs.php.net/bug.php?id=45392
https://github.com/php/php-src/commit/fcc0fdd125fdb9e1713f91d027fe07d680a0cf36
2021-05-31 15:42:10 +02:00
Christoph M. Becker c8244dd989 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix typo in test case (doe → die)
2021-05-29 15:40:15 +02:00
Christoph M. Becker 140eca603c Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix typo in test case (doe → die)
2021-05-29 15:39:17 +02:00
Christoph M. Becker 4ab434fa0e Fix typo in test case (doe → die) 2021-05-29 15:36:40 +02:00
Anatol Belski 56c16334e5 ext: Cleanup some dead assignments
Signed-off-by: Anatol Belski <ab@php.net>
2021-05-29 13:03:32 +02:00
Nikita Popov ea256a218b Add %0 format to run-tests.php
This format matches against null bytes, and prevents the test
expectation from being interpreted as binary data.

bless_tests.php will automatically replace \0 with %0 as well.
2021-05-29 11:33:13 +02:00
Máté Kocsis 48981f4f1e Declare tentative return types for ext/standard (#7065) 2021-05-28 15:46:04 +02:00
twosee 2389ac229f Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix argument index in stream_select()
2021-05-28 17:41:52 +08:00
twosee b751c24e23 Fix argument index in stream_select()
Closes GH-7067.
2021-05-28 17:37:51 +08:00
Máté Kocsis 5beba0b038 Declare tentative return types for ext/json (#7051) 2021-05-27 10:47:15 +02:00
Máté Kocsis b4b848bfa7 Fix the signature of ini_alter()
It should be the same as ini_set()
2021-05-26 12:32:38 +02:00
David CARLIER 90b843beb6 Add FreeBSD to CI (#6974)
This is using Cirrus, as none of the CI providers we already use support FreeBSD.
2021-05-21 12:00:46 +02:00
Nikita Popov f9990009c8 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix handling of open_basedir that contains cwd
2021-05-20 09:53:57 +02:00
Nikita Popov ef59d09af0 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix handling of open_basedir that contains cwd
2021-05-20 09:53:25 +02:00
Nikita Popov ee7a8acde9 Fix handling of open_basedir that contains cwd
While resolving the path, the last step will reduce it down to ""
(an empty string) and realpath() will resolve this to getcwd().
If open_basedir contains the CWD, then that means open_basedir
will be bypassed for paths that don't have any components that
exist (if one of the components exists, then we abort the realpath
loop at that point).

Closes GH-7015.
2021-05-20 09:52:21 +02:00
Nikita Popov 11bf5ccf62 Set default_socket_timeout in test
If the read is not refused outright, this will timeout, and we
don't want to wait 60s for that.
2021-05-19 15:29:38 +02:00
Nikita Popov 23c90dcdfb Report error from socket read on timeout
A timeout is not considered a transient error (at the socket layer),
and should return -1 rather than 0.
2021-05-19 15:29:16 +02:00
Nikita Popov 4c15dffe3a Reduce timeout in FTP PASV connection failure test
If the connection times out rather than being refused outright,
don't wait the full 60 seconds that are used by default. If this
happens, the error message will also be different.
2021-05-19 15:08:40 +02:00
Christoph M. Becker adb0e4f18d Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #81048: phpinfo(INFO_VARIABLES) "Array to string conversion"
2021-05-19 14:10:02 +02:00
Christoph M. Becker 5dfdd694e7 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #81048: phpinfo(INFO_VARIABLES) "Array to string conversion"
2021-05-19 14:09:21 +02:00
Christoph M. Becker 36b9bdeeec Fix #81048: phpinfo(INFO_VARIABLES) "Array to string conversion"
Now that we properly dereference references of the superglobals. we
also need to dereference contained references to avoid to string
conversion.

Closes GH-7014.
2021-05-19 14:07:15 +02:00
Nikita Popov 0fd796133a Drop test that is always skipped
This test is skipped unconditionally, so I don't think there's
much point in keeping it.
2021-05-19 13:02:30 +02:00
Nikita Popov 2c6b85f6fe Remove bug49936.phpt
In the meantime, additional tests for ftp:// with opendir() have
been added, which tests actual behavior against a server. This one
just uses localhost (without running a server), which can make the
test very slow on systems that don't refuse the connection outright.
2021-05-19 12:14:16 +02:00
Nikita Popov 976dd997de Fix open_basedir tests when running from /tmp
If our cwd is in /tmp, these tests would fail. Use a directory
name that is less likely to clash.
2021-05-19 10:36:44 +02:00
Nikita Popov 06ea1a2502 Skip some strptime() tests on FreeBSD
tm_wday/tm_yday generally have unreliable behavior. What we're
testing is how glibc works.
2021-05-18 19:33:57 +02:00
Nikita Popov 11648c00e9 Don't include object hash in SplObjectStorage debug dump
The object hash is not particularly useful (anymore) and just
clutters the output. It encodes the same information as the
object ID, which is already part of the output.
2021-05-18 17:20:20 +02:00
George Peter Banyard db1bde73cf Use equals OR equal instead of >= && <=
For only two values this is clearer
2021-05-18 15:08:12 +01:00
George Peter Banyard e7135cb817 Use zend_string_equals_* API in a couple of more place
Closes GH-6979
2021-05-14 13:45:17 +01:00
George Peter Banyard aca6aefd85 Remove 'register' type qualifier (#6980)
The compiler should be smart enough to optimize this on its own
2021-05-14 13:38:01 +01:00
K 21422e8536 Optimize unpack() for named fields (#6958)
Create name using either zend_init_string_fast (no repetitions) or by concatenating the name with zend_print_ulong_to_buf. This is much more efficient than using snprintf. We also avoid repeated strlen() calculations.
2021-05-14 11:32:46 +02:00
George Peter Banyard b7356692f6 Specify function pointer signature for scanf implementation
Fix [-Wstrict-prototypes] warnings in standard/scanf.c
2021-05-12 18:58:44 +01:00
George Peter Banyard c40231afbf Mark various functions with void arguments.
This fixes a bunch of [-Wstrict-prototypes] warning,
because in C func() and func(void) have different semantics.
2021-05-12 14:55:53 +01:00
dwgebler f5139878f9 Check parameters on compact() and throw warning if not string or array of strings (#6921)
compact() is documented (https://www.php.net/manual/en/function.compact) as a variadic function accepting parameters which are strings or arrays of strings referencing defined symbols.

In actuality, passing nonsense parameters e.g. compact(true, 42) merely returns an empty array. I propose throwing a warning in these cases, to prevent silent bugs.
2021-05-11 09:36:12 +02:00
Michael Voříšek 3ccc0409ce Remove no longer used "log_errors_max_len" ini directive (#6838)
This is a re-application of the original match against master.
The patch was originally applied to master, then reverted from
there, incorrectly applied to PHP-8.0, reverted from there due
to ABI break, and now lands on master again. We can only hope
that it does not get reverted again ;)
2021-05-10 19:26:33 +02:00
Nikita Popov 4f46bec5d4 Initialize zpp varargs variables
These are not initialized if no args are passed.
2021-05-10 19:19:26 +02:00
Aaron Piotrowski 39fa55a4c9 Switch register_tick_function back to zend_parse_parameters
No reason to use fast ZPP in register_tick_function, so let’s keep the binary size down just a bit.
2021-05-10 10:17:29 -05:00
George Peter BanyardandAaron Piotrowski a9695cc615 Refactor register shutdown function mechanism
Use FCI/FCC structure instead of custom implementation which does the same.
This also fixes the "bug" which prevented static methods from being shutdown functions.

Closes GH-5829

Co-authored-by: Aaron Piotrowski <aaron@trowski.com>
2021-05-10 15:54:59 +01:00
Aaron Piotrowski 66bfad57de Remove unnecessay NULL
Z_PARAM_FUNC already sets params to NULL.
2021-05-09 14:55:05 -05:00
Aaron Piotrowski 0189585c9e Fix tick function with arguments
Tick function arguments need to be copied to fci params.
2021-05-09 14:08:20 -05:00
Aaron Piotrowski 7ec048f96d Do not free tick function entry
This memory is freed by zend_llist.
2021-05-09 11:44:32 -05:00
Nikita Popov 090627048c Revert "Remove no longer used "log_errors_max_len" ini directive (#6838)"
This reverts commit d2d227e547.

This is an ABI break.
2021-05-08 20:54:53 +02:00
Ben Ramsey b5d5d06ff3 Revert "Remove no longer used "log_errors_max_len" ini directive (#6838)"
This reverts commit cc2c810dcf.
2021-05-08 13:23:58 -05:00
Michael Voříšek d2d227e547 Remove no longer used "log_errors_max_len" ini directive (#6838) 2021-05-08 13:05:13 -05:00
Remi Collet 99d67d121a use getnameinfo instead of gethostbyaddr 2021-05-08 14:52:06 +02:00
George Peter Banyard 05e6f3ebde Refactor register_tick_function mechanism (#5828) 2021-05-08 10:09:09 +01:00
Michael Voříšek cc2c810dcf Remove no longer used "log_errors_max_len" ini directive (#6838) 2021-05-07 19:07:35 -05:00
Nikita Popov 32b107e6a6 Use smart_str_extend() instead of smart_str_alloc()
These usages were re-implementing the exact functionality of
smart_str_extend().
2021-05-07 16:42:17 +02:00
Nikita Popov 072c50fc77 Merge branch 'PHP-8.0'
* PHP-8.0:
  Update msan job to Ubuntu 20.04
  Skip some tests under msan
2021-05-07 16:28:57 +02:00