Commit Graph

1414 Commits

Author SHA1 Message Date
Kamil Tekiela
012abcdb52
Update UPGRADING 2022-07-06 12:28:54 +01:00
Sebastian Bergmann
eb5b12c225
[ci skip] Fix typo 2022-07-03 07:16:53 +02:00
David Carlier
fdc09e302a Fix GH-8907: Document forgotten API changes.
binary safe string comparisons and recent socket option addition.

Closes #8910.
2022-07-02 20:42:39 +01:00
Remi Collet
63c7418b91
[ci skip] NEWS and UPGRADING 2022-06-28 15:19:56 +02:00
Ayesh Karunaratne
526af6ea67
[ci skip] Add true type support to UPGRADING file
Closes GH-8826.
2022-06-19 12:28:35 +02:00
tobil4sk
5bb3e233db
Implement #77726: Allow null character in regex patterns
In 8b3c1a3, this was disallowed to fix #55856, which was a security
issue caused by the /e modifier. The fix that was made was the
"Easier fix" as described in the original report.

With this fix, pattern strings are no longer treated as null terminated,
so null characters can be placed inside and matched against with regex
patterns without security problems, so there is no longer a reason to
give the error. Allowing this is consistent with the behaviour of many
other languages, including JavaScript, and thanks to PCRE2[0], it does
not require manually escaping null characters. Now that we can avoid the
error here without the cost of escaping characters, there is really no
need anymore to stray here from the conventional behaviour.

Currently, null characters are still disallowed before the first
delimiter and in the options section at the end of a regex string, but
these error messages have been updated.

[0] Since PCRE2, pattern strings no longer have to be null terminated,
and raw null characters match as normal.

Closes GH-8114.
2022-06-17 19:30:44 +02:00
Arnaud Le Blanc
efc8f0ebf8
Deprecate zend_atol() / add zend_ini_parse_quantity() (#7951)
Add zend_ini_parse_quantity() and deprecate zend_atol(), zend_atoi()

zend_atol() and zend_atoi() don't just do number parsing.
They also check for a 'K', 'M', or 'G' at the end of the string,
and multiply the parsed value out accordingly.

Unfortunately, they ignore any other non-numerics between the
numeric component and the last character in the string.
This means that numbers such as the following are both valid
and non-intuitive in their final output.

* "123KMG" is interpreted as "123G" -> 132070244352
* "123G " is interpreted as "123 " -> 123
* "123GB" is interpreted as "123B" -> 123
* "123 I like tacos." is also interpreted as "123." -> 123

Currently, in php-src these functions are used only for parsing ini values.

In this change we deprecate zend_atol(), zend_atoi(), and introduce a new
function with the same behavior, but with the ability to report invalid inputs
to the caller. The function's name also makes the behavior less unexpected:
zend_ini_parse_quantity().

Co-authored-by: Sara Golemon <pollita@php.net>
2022-06-17 14:12:53 +02:00
Pierrick Charron
b9af4335e3
Add new curl_upkeep() function 2022-06-13 18:15:21 -04:00
Pierrick Charron
cec20f615d
Expose new constants from libcurl 7.62 to 7.80 2022-06-13 18:15:21 -04:00
Rowan Tommins
d9f3ca705c
Add deprecation notices to utf8_encode and utf8_decode
Implements initial stage of accepted RFC to remove them:
https://wiki.php.net/rfc/remove_utf8_decode_and_utf8_encode

Tests relating to SOAP and htmlspecialchars seem to have been
using this entirely unnecessarily, so have been fixed.

Closes GH-8726.
2022-06-12 13:37:23 +02:00
David CARLIER
6b02cabc8a Add SO_SETFIB FreeBSD socket option constant.
Aims to set the route table.
Closes #8742.
2022-06-11 13:03:21 +01:00
George Peter Banyard
dbf1cafd77
Remove internal usage of SplFileInfo::_bad_state_ex() method (#8318)
* Use standard VM handling instead
 * Deprecate the method as it is now useless
2022-06-09 13:24:58 +01:00
David Carlier
d677cc13ce Add SO_BPF_EXTENSIONS flag to socket.
Returns the supported bpf extensions from the kernel. Linux only.
Closes GH-8713.
2022-06-08 05:14:57 +01:00
George Peter Banyard
80fda5ff9e [skip ci] Update UPGRADING in regards to iterable compile time alias 2022-06-07 13:48:47 +01:00
David Carlier
6fe7ff95d9 Implements ancillary data on NetBSD.
With the couple LOCAL_CREDS/SCM_CREDS, in this system we get all the
infos needed (included the process id).
Closes GH-8700.
2022-06-06 23:06:01 +01:00
David CARLIER
f813520b50
Implements socket ancillary data on FreeBSD. (#7708)
using LOCAL_CREDS_PERSISTENT/SCM_CREDS2 instead so we also get the send process id.
2022-06-02 14:08:03 +01:00
Kamil Tekiela
2d1a320ba9
UPGRADING for libmysql change 2022-05-30 16:22:48 +01:00
Máté Kocsis
1d168a448b
Add upgrading entry for DatePeriod property changes
[skip ci]
2022-05-28 08:50:03 +02:00
Calvin Buckley
2920a26636
Quote when adding to connection string in (PDO_)ODBC
Because the UID= and PWD= values are appended to the SQLDriverConnect
case when credentials are passed, we have to append them to the string
in case users are relying on this behaviour. However, they must be
quoted, or the arguments will be invalid (or possibly more injected).
This means users had to quote arguments or append credentials to the raw
connection string themselves.

It seems that ODBC quoting rules are consistent enough (and that
Microsoft trusts them enough to encode into the .NET BCL) that we can
actually check if the string is already quoted (in case a user is
already quoting because of this not being fixed), and if not, apply the
appropriate ODBC quoting rules.

This is because the code exists in main/, and are shared between
both ODBC extensions, so it doesn't make sense for it to only exist
in one or the other. There may be a better spot for it.

Closes GH-8307.
2022-05-27 16:56:44 +02:00
Arnaud Le Blanc
059474a846 [ci skip] NEWS, UPGRADING 2022-05-27 14:08:22 +02:00
Máté Kocsis
df77fee28d
Add upgrading entry for ext/tidy property changes
[skip ci]
2022-05-26 08:32:06 +02:00
Máté Kocsis
54de945b87
Added a few missing punctuation marks in UPGRADING 2022-05-23 09:51:43 +02:00
Máté Kocsis
7ec2950d79
Add upgrading entry for readonly classes 2022-05-23 09:48:41 +02:00
David CARLIER
016ac7c132
[skip ci] UPGRADING note update, follow-up #8411 (#8598) 2022-05-21 12:12:09 +02:00
Christoph M. Becker
33fc9e5a77
Build ext/zip as shared library by default on Windows
This allows users to use PECL/zip, which is well maintained and often
brings new features which are not yet available in ext/zip, as drop-in
replacement for the official Windows php-src builds.

Closes GH-8549.
2022-05-20 14:31:32 +02:00
David Carlier
1f4830f21a
Add TCP_NOTSENT_LOWAT socket option
Can be used to limit the amount of unsent data per socket.

Closes GH-8559.
2022-05-16 16:01:38 +02:00
David Carlier
10921525e6
Add CURLOPT_MAXFILESIZE_LARGE option
Like other *LARGE options, it takes a 64 bit value.

Closes GH-8557.
2022-05-16 11:01:28 +02:00
Máté Kocsis
8b991b4ae4
Add static return type for DateTime*::createFrom*() when possible
Fix GH-8544
2022-05-13 12:13:48 +02:00
Ollie Read
f590782b60
Add ReflectionMethod::hasPrototype method
Closes GH-8487.
2022-05-09 16:48:54 +02:00
Nicolas Grekas
be11bcb0b1
Add ReflectionFunction::isAnonymous()
Closes GH-8499.
2022-05-09 12:56:10 +02:00
Ilija Tovilo
4556f9db5a
[skip ci] Fix alternative string interpolation suggestion in UPGRADING 2022-05-05 17:49:20 +02:00
Ilija Tovilo
9a90bd7054
Deprecate ${} string interpolation
https://wiki.php.net/rfc/deprecate_dollar_brace_string_interpolation
2022-05-05 10:14:56 +02:00
David Carlier
7a45dcfe2e
Introduce CURLOPT_XFERINFOFUNCTION
`CURLOPT_XFERINFOFUNCTION` is available as of cURL 7.32.0, and
supersedes `CURLOPT_PROGRESSFUNCTION` which is still supported by
latest cURL, though.

Closes GH-7823.
2022-04-22 18:09:06 +02:00
George Peter Banyard
7061c40f43
[skip-ci] update UPGRADING 2022-04-20 17:43:10 +01:00
bohwaz
2973b9f02a
Allow user to change SQLITE_DEFENSIVE if needed
Closes GH-8200.
2022-04-11 17:08:48 +02:00
George Peter Banyard
3931d726c4
Add missing ZPP checks in SPL Directory (#8325)
Co-authored-by: Máté Kocsis <kocsismate@woohoolabs.com>
2022-04-08 17:58:10 +01:00
Ilija Tovilo
cdf7240f75
[skip ci] Remove superfluous backslash in UPGRADING 2022-04-08 11:00:28 +02:00
Tim Düsterhus
9085197734
Implement the "Redacting parameters in back traces" RFC
https://wiki.php.net/rfc/redact_parameters_in_back_traces
2022-04-08 10:36:16 +02:00
Paragon Initiative Enterprises
afd8f84c1a
Add sodium_crypto_stream_xchacha20_xor_ic()
There are many use-cases where a PHP user is currently using sodium_compat's implementation of this low-level XChaCha20 API. For example, multi-part message processing (in low-memory settings) for a ciphertext that was encrypted with XChaCha20-Poly1305 (rather than the secretstream API).

Adding this function to ext/sodium offers better performance and lowers users' memory usage with the polyfill, and ensures that users coming from other languages that provide libsodium bindings have a more consistent experience with our bindings. This is a win-win.

This patch follows the libsodium precedent of adding functions instead of optional parameters to existing functions. The parameter order is also consistent with the C API.

https://doc.libsodium.org/advanced/stream_ciphers/xchacha20#usage

Closes GH-8276.
2022-04-04 15:43:42 +02:00
Patrick Allaert
67440096c5
Added: [zend_]memory_reset_peak_usage() (#8151) 2022-03-04 13:24:08 +01:00
Christoph M. Becker
f06ac9a486
Fix GH-7939: Cannot unserialize IntlTimeZone objects
As it is now, `IntlTimeZone`, `IntlCalendar` and `IntlDateFormatter`
and some other intl class instances can be serialized, but the
representation is meaningless, and unserialization yields uninitialized/
unusable objects.  To prevent users from noticing this too late, we deny
serialization of such objects in the first place.

Closes GH-7945.
2022-02-17 15:06:29 +01:00
David Carlier
3414ae6c0c
sockets: add SO_INCOMING_CPU constant
get/set the cpu attached to a socket, no special treatment needed,
it is simply an integer.

Closes GH-7753.
2021-12-20 14:58:09 +01:00
Christoph M. Becker
30a3280df7
Oracle Client 10g is no longer supported
Thus, we drop respective config option for Windows.
2021-12-15 22:09:58 +01:00
Yannis Guyon
38460c2c94
Implement php_handle_avif() using libavifinfo
See #80828 and the internals@ mailing list discussion at
https://externals.io/message/116543

Use libavifinfo's AvifInfoGetFeaturesStream() in php_handle_avif() to
get the width, height, bit depth and channel count from an AVIF
payload. Implement stream reading/skipping functions and data struct.
Use libavifinfo's AvifInfoIdentifyStream() in php_is_image_avif().

Update the expected features read from "test1pix.avif" in
getimagesize.phpt.

Closes GH-7711.
2021-12-15 20:27:40 +01:00
Tim Starling
8eee0d6130
Make strtolower() and strtoupper() do ASCII case conversion (#7506)
Implement RFC https://wiki.php.net/rfc/strtolower-ascii
2021-12-15 08:38:35 -05:00
Christopher Jones
93f6af6913
It's past time to drop linking support for Oracle Client 10g 2021-12-12 13:58:04 +11:00
Christopher Jones
ac91b83ceb
Add oci_set_prefetch_lob() 2021-12-11 21:38:08 +11:00
Nikita Popov
902d64390e Deprecate implicit dynamic properties
Writing to a proprety that hasn't been declared is deprecated,
unless the class uses the #[AllowDynamicProperties] attribute or
defines __get()/__set().

RFC: https://wiki.php.net/rfc/deprecate_dynamic_properties
2021-11-26 14:10:11 +01:00
Christopher Jones
9cd7f41fac
Add oci8.prefetch_lob_size 2021-11-12 17:59:22 +11:00
George Peter Banyard
7db32add9b
Refactor dba_(p)open() to be more sensible (#7610)
Actually use ZPP
Throw ValueErrors for invalid values
Use dedicated struc members for file permission and map size instead of a zval stack
2021-11-06 23:09:40 +00:00
DmitryMaksimov
2b32cafd88
Use neutral language instead of default on Windows
Most notably, this affects some Windows specific error messages, which
are no longer in the default language of the system, to better match
error messages provided by PHP which are not localized anyway.

This also affects the com_dotnet extension, where it could fix some
DCOM related issues.  Furthermore, the constant `LOCALE_NEUTRAL` is
added, which can be used for `variant_cmp()`.

Closes GH-7613.
2021-11-03 19:39:20 +01:00
Felipe Pena
e089a50f53 Add support for PCRE n modifier
Add support for /n (NO_AUTO_CAPTURE) modifier, which makes simple
`(xyz)` groups non-capturing.

Closes GH-7583.
2021-11-03 15:17:54 +01:00
Alex Dowad
9308974f8c Deprecate use of mbstring to convert text to Base64/QPrint/HTML entities/etc
The purpose of mbstring is for working with Unicode and legacy text
encodings; but Base64, QPrint, etc. are not text encodings and don't
really belong in mbstring. PHP already contains separate implementations
of Base64, QPrint, and HTML entities. It will be better to eventually
remove these non-encodings from mbstring.

Regarding HTML entities... there is a bit more to say. mbstring's
implementation of HTML entities is different from the other built-in
implementation (htmlspecialchars and htmlentities). Those functions
convert <, >, and & to HTML entities, but mbstring does not.

It appears that the original author of mbstring intended for something
to be done with <, >, and &. He used a table to identify which
characters should be converted to HTML entities, and </>/& all have a
special value in that table. However, nothing ever checks for that
special value, so the characters are passed through unconverted.

This seems like a very useless implementation of HTML entities. The most
important characters which need to be expressed as entities in HTML
documents are those three!
2021-11-01 11:23:21 +02:00
Sergey Panteleev
5e7e654514
Fix a method name ZipArchive::clearError typo
Closes GH-7616.
2021-10-27 13:02:10 +02:00
George Peter Banyard
e56c506020
Refactor DBA
Use proper ZPP union types
Use standard function signature semantics for dba_fetch()
Re-ordering of checks
2021-10-23 12:04:23 +01:00
Nikita Popov
ee510eed68 Deprecate partially supported callables
This deprecates all callables that are accepted by
call_user_func($callable) but not by $callable(). In particular:

    "self::method"
    "parent::method"
    "static::method"
    ["self", "method"]
    ["parent", "method"]
    ["static", "method"]
    ["Foo", "Bar::method"]
    [new Foo, "Bar::method"]

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

Closes GH-7446.
2021-10-22 10:15:24 +02:00
Ayesh Karunaratne
d23e36da81 Add CURLINFO_EFFECTIVE_METHOD
Since Curl 7.72.0, it supports a new parameter
called `CURLINFO_EFFECTIVE_METHOD`, which returns the effect method
in HTTP(s) requests. This is similar to `CURLINFO_EFFECTIVE_URL`.

 - https://curl.se/libcurl/c/CURLINFO_EFFECTIVE_METHOD.html

This adds support for CURLINFO_EFFECTIVE_URL if ext/curl is built
with libcurl >= 7.72.0 (0x074800).

Closes GH-7595.
2021-10-21 10:33:40 +02:00
Remi Collet
e9b96ae5da
Add ZipArchive::clearError, getStreamIndex and getStreamName methods
public function clearError(): void {}
    public function getStreamIndex(int $index, int $flags = 0) {}
    public function getStreamName(string $name, int $flags = 0) {}

ZipArchive::getStream is kept for BC

See https://github.com/pierrejoye/php_zip/issues/20
2021-10-11 15:39:35 +02:00
Nikita Popov
9d8f97d58d Revert "Fix DATE_FORMAT_COOKIE definition"
This reverts commit ac34648cf6.

As pointed out on GH-6783, the new format doesn't match any of
the specified formats. Previously the constant generated

    Thursday, 14-Jul-2005 22:30:41 BST

which is obsolete. Now it generates

    Thu, 14-Jul-2005 22:30:41 BST

which is not specified at all. The correct version would be:

    Thu, 14 Jul 2005 22:30:41 BST

Reverting the change for now.
2021-09-29 09:26:40 +02:00
Mahmood Dhia
ac34648cf6 Fix DATE_FORMAT_COOKIE definition
In all of http://curl.haxx.se/rfc/cookie_spec.html,
https://docs.microsoft.com/de-de/windows/win32/wininet/http-cookies
and https://tools.ietf.org/html/rfc7234#section-5.3 the cookie
datetime is specified as Mon, DD-Mon-YYYY HH:MM:SS GMT. However,
the current definition returns Monday, DD-Mon-YYY HH:MM:SS GMT.
Therefore, the "l" in "l, d-M-Y H:i:s T" must be changed to "D".

Closes GH-6783.
2021-09-23 16:01:04 +02:00
Patrick Allaert
1c33ddb5e5
Prepare for PHP 8.2 2021-08-31 19:13:49 +02:00
Nikita Popov
a968055b77 Add UPGRADING for ini parser changes
Missed the "git add" once again...

[ci skip]
2021-08-31 10:09:34 +02:00
Nikita Popov
7b34db0659 Switch default PKCS7/CMS cipher to AES-128-CBC
Switch default cipher for openssl_pkcs7_encrypt() and
openssl_cms_encrypt() from RC2-40 to AES-128-CBC.

The RC2-40 cipher is considered insecure and is not loaded by
default in OpenSSL 3, which means that these functions will
always fail with default arguments.

As the used algorithm is embedded in the result (which makes this
different from the openssl_encrypt() case) changing the default
algorithm should be safe.

Closes GH-7357.
2021-08-16 12:31:48 +02:00
Ben Morss
eb6c9eb936
Lossless conversion for webp
Propagating lossless conversion from libgd to our bundled gd.
Changing "quantization" to "quality" as in libgd.
Adding test.

IMG_WEBP_LOSSLESS is only defined, if lossless WebP encoding is
supported by the libgd used.

Closes GH-7348.
2021-08-12 23:19:13 +02:00
Remi Collet
1100a079ed
NEWS 2021-08-11 14:21:18 +02:00
Remi Collet
5d57d9073c
NEWS 2021-08-11 13:04:23 +02:00
Nikita Popov
f2d3e75933 Do not special case export of EC keys
All other private keys are exported in PKCS#8 format, while EC
keys use traditional format. Switch them to use PKCS#8 format as
well.

As the OpenSSL docs say:

> PEM_write_bio_PrivateKey_traditional() writes out a private key
> in the "traditional" format with a simple private key marker and
> should only be used for compatibility with legacy programs.
2021-08-06 11:25:44 +02:00
Christoph M. Becker
ff8e04ac30
[ci skip] UPGRADING: oci8.old_oci_close_semantics has been deprecated 2021-07-25 14:51:15 +02:00
Nikita Popov
6780aaa532 Implement readonly properties
Add support for readonly properties, for which only a single
initializing assignment from the declaring scope is allowed.

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

Closes GH-7089.
2021-07-20 12:05:46 +02:00
Kamil Tekiela
052af90b86 Deprecate autovivification on false
Deprecate automatically converting "false" into an empty array
on write operands. Autovivification continues to be supported
for "null" values, as well as undefined/uninitialized values.

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

Closes GH-7131.

Co-authored-by: Tyson Andre <tysonandre775@hotmail.com>
Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
2021-07-19 14:49:37 +02:00
George Peter Banyard
453a5163ce [skip-ci] Fixup UPGRADING documents
Some entries were in the wrong section/wrong document.
2021-07-17 23:27:26 +02:00
Nikita Popov
edb6b375dd Don't return bool from Phar::offsetUnset()
This violates the ArrayAccess interface. Use offsetExists() to
check if an entry exists.
2021-07-16 16:39:27 +02:00
Nikita Popov
172f84bfe4 Add UPGRADING entry for socket options
[ci skip]
2021-07-16 12:21:21 +02:00
George Peter Banyard
0ba155cd57 Make syslog() binary safe
Closes GH-7245

Co-authored-by: Nikita Popov <nikita.ppv@googlemail.com>
2021-07-15 19:08:26 +02:00
Nikita Popov
53aed48e5d Allow objects in define()
This was separately discussed in https://externals.io/message/114863,
but also necessary for consistency now that
https://wiki.php.net/rfc/new_in_initializers has landed.

Closes GH-7149.
2021-07-15 10:09:56 +02:00
Joe Watkins
d0b09a7be4 Add first-class callables
Support acquiring a Closure to a callable using the syntax
func(...), $obj->method(...), etc. This is essentially a
shortcut for Closure::fromCallable().

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

Closes GH-7019.

Co-Authored-By: Nikita Popov <nikita.ppv@gmail.com>
2021-07-14 14:37:25 +02:00
Christoph M. Becker
e1285c4aa5
Deprecate $num_points parameter of image(open|filled)polygon
Cf. <https://wiki.php.net/rfc/deprecations_php_8_1#num_points_parameter_of_image_open_filled_polygon>.

Co-authored-by: Máté Kocsis <kocsismate@woohoolabs.com>
Co-authored-by: George Peter Banyard <7906688+Girgias@users.noreply.github.com>

Closes GH-6789.
2021-07-14 10:56:24 +02:00
Nikita Popov
4b3615a33f Deprecate strftime() and gmstrftime()
These are deprecated in favor of date()/DateTime::format() (for
locale-indendent formatting) and IntlDateFormatter::format()
(for locale-dependent formatting).

Part of https://wiki.php.net/rfc/deprecations_php_8_1.
2021-07-14 09:38:43 +02:00
Nikita Popov
9491694903 Deprecate SoapClient ssl_method option
Instead use ssl stream context options instead. The direct
equivalent would be crypto_method, but min_proto_version /
max_proto_version are recommended instead.

Part of https://wiki.php.net/rfc/deprecations_php_8_1.
2021-07-14 09:36:26 +02:00
Nikita Popov
52d3d0d8d7 Add limited support for new in initializers
Add support for new expressions inside parameter default values,
static variable initializers, global constant initializers and
attribute arguments.

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

Closes GH-7153.
2021-07-13 14:03:20 +02:00
Nikita Popov
aa733e8ac8 Deprecate filter.default
There's a subtlety here regarding filter.default_flags. The RFC
stated that no separate deprecation warning will be emitted for
it, on the premise that it is only meaningful if filter.default
is set. However, it turns out that even FILTER_UNSAFE_RAW (which
is the "no-op filter") can be combined with stripping flags.
However, this is compensated by the fact that this doesn't actually
work when setting filter.default=unsafe_raw and non-default
filter.default_flags -- the flags are simply ignored in that case.
So everything works out in the end.

Part of https://wiki.php.net/rfc/deprecations_php_8_1.
2021-07-12 09:33:08 +02:00
George Peter Banyard
1f42777927 Deprecate using the implicit default PgSQL connection
The DB connection should be provided in all cases as the first argument.
The overloaded function signatures will be removed in the future.
Warn about this change.

Part of https://wiki.php.net/rfc/deprecations_php_8_1.
2021-07-09 23:12:37 +02:00
Nikita Popov
a80360dbed Deprecate direct access to static trait members
Static trait members may only be accessed through a class in which
the trait is used, not directly on the trait.

A complication here is that we should not store static
methods/properties for which a deprecation is triggered in a
cache slot. As the check for this is simple and cheap, I'm handling
this in the cache slot population code in the VM. The alternative
would be to pass the cache slot down into the fetching code.

Part of https://wiki.php.net/rfc/deprecations_php_8_1.
2021-07-09 14:12:28 +02:00
Nikita Popov
08069165aa Deprecate ctype_*() on non-string arguments
Non-string arguments will be interpreted as strings in the future.
Warn about the upcoming behavior change.

Part of https://wiki.php.net/rfc/deprecations_php_8_1.
2021-07-09 12:00:35 +02:00
Nikita Popov
232aa34b9f Deprecate auto_detect_line_endings
Part of https://wiki.php.net/rfc/deprecations_php_8_1.
2021-07-09 10:05:57 +02:00
Nikita Popov
bed7139375 Deprecate strptime()
Use date_parse_from_format() or IntlDateFormatter::parse() instead.

Part of https://wiki.php.net/rfc/deprecations_php_8_1.
2021-07-09 10:03:45 +02:00
Nikita Popov
2bc23cc6e3 Deprecate imap NIL constant
Part of https://wiki.php.net/rfc/deprecations_php_8_1.
2021-07-08 16:48:16 +02:00
Nikita Popov
f0b190c32d Deprecate return by ref from void function
Part of https://wiki.php.net/rfc/deprecations_php_8_1.
2021-07-08 16:47:37 +02:00
Nikita Popov
bf94010b4b Deprecate FILTER_SANITIZE_STRING/STRIPPED
Deprecate the FILTER_SANITIZE_STRING and FILTER_SANITIZE_STRIPPED
filters.

This is part of https://wiki.php.net/rfc/deprecations_php_8_1.
2021-07-08 16:46:59 +02:00
Nikita Popov
1c07b11b1c Deprecate odbc_result_all()
Part of https://wiki.php.net/rfc/deprecations_php_8_1.
2021-07-08 16:46:08 +02:00
Nikita Popov
625b89af2f Deprecate mysqli::init()
In favor of parent::__construct().

Part of https://wiki.php.net/rfc/deprecations_php_8_1.
2021-07-08 16:45:05 +02:00
Nikita Popov
bf0c1ce1a0 Deprecate mhash
Deprecate mhash(), mhash_keygen_s2k(), mhash_count(),
mhash_get_block_size() and mhash_get_hash_name() in favor of the
normal hash_*() functions.

Part of https://wiki.php.net/rfc/deprecations_php_8_1.
2021-07-08 15:34:51 +02:00
Nikita Popov
1c50784ae7 Deprecate IntlCalendar::roll() with bool argument
Pass 1 instead of true and -1 instead of false.

Part of https://wiki.php.net/rfc/deprecations_php_8_1.
2021-07-08 15:34:51 +02:00
Nikita Popov
92f6e21523 Deprecate FILE_BINARY and FILE_TEXT constants
These constants have no effect.

Part of https://wiki.php.net/rfc/deprecations_php_8_1.
2021-07-08 15:34:51 +02:00
Nikita Popov
639015845f Deprecate calling mb_check_encoding() without argument
Part of https://wiki.php.net/rfc/deprecations_php_8_1.
2021-07-08 15:34:49 +02:00
Nikita Popov
dcc8463ae5 Deprecate IAP functions on objects
Deprecate use of key(), current(), next(), prev(), reset() and
end() on objects. Cast the object to array first.

Part of https://wiki.php.net/rfc/deprecations_php_8_1.
2021-07-08 15:28:33 +02:00
Nikita Popov
5bb83b3778 Deprecate date_sunrise() and date_sunset()
date_sunrise() and date_sunset() are deprecated in favor of
date_sun_info().

Part of https://wiki.php.net/rfc/deprecations_php_8_1.
2021-07-08 15:27:08 +02:00
Marco Pivetta
6e16e1daa9 Make ReflectionProperty/Method always accessible
With this patch, it is no longer required to call
`ReflectionProperty#setAccessible()` or
`ReflectionMethod#setAccessible()` with `true`.

If a userland consumer already got to the point of accessing
object/class information via reflection, it makes little sense
for `ext/reflection` to disallow accessing `private`/`protected`
symbols by default.

After this patch, calling `ReflectionProperty#setAccessible(true)`
or `ReflectionMethod#setAccessible(true)` on newly instantiated
`ReflectionProperty` or `ReflectionMethod` respectively will have
no effect.

RFC: https://wiki.php.net/rfc/make-reflection-setaccessible-no-op

Closes GH-5412.
2021-07-08 10:55:38 +02:00
Máté Kocsis
a5360e80c2
Add support for final class constants
RFC: https://wiki.php.net/rfc/final_class_const

Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
2021-07-06 21:42:38 +02:00
George Peter Banyard
069a9fa5e4
Pure Intersection types (#6799)
Implement pure intersection types RFC

RFC: https://wiki.php.net/rfc/pure-intersection-types

Co-authored-by: Nikita Popov <nikic@php.net>
Co-authored-by: Ilija Tovilo <ilutov@php.net>
2021-07-05 14:11:03 +02:00
Cameron Porter
b11785c5e4 Fixed bug #81085: Add version 7.71.0 blob options.
Adds support for the following options beginning with version 7.71.0:

    CURLOPT_ISSUERCERT_BLOB
    CURLOPT_PROXY_ISSUERCERT
    CURLOPT_PROXY_ISSUERCERT_BLOB
    CURLOPT_PROXY_SSLCERT_BLOB
    CURLOPT_PROXY_SSLKEY_BLOB
    CURLOPT_SSLCERT_BLOB
    CURLOPT_SSLKEY_BLOB

Closes GH-7194.
2021-06-28 09:54:45 +02:00
Juliette
fb70194850
UPGRADING: update information re: return type for internal methods (#7182)
As discussed in 7051.
2021-06-22 08:33:55 +02:00
Joe Watkins
ed88daecf4
missing news/upgrading entry 2021-06-18 11:25:36 +02:00
Nikita Popov
deb7955bf4 Fix #81150 Add UPGRADING note for float to int deprecation
[ci skip]
2021-06-17 09:52:44 +02:00
Nikita Popov
1c08f8a48a Allow named args after unpack
Currently, argument unpacking and named arguments cannot be mixed
at all. This relaxes the restriction to allow
foo(...$args, named: $arg). The variant foo(named: $arg, ...$args)
is still forbidden, because we can't ensure that positional
parameters come before named parameters in that case (without more
intrusive changes). Effectively this just enforces a required style,
as the order of unpack and named args doesn't matter for the cases
where both could be well-defined.

ML discussion: https://externals.io/message/114589

Closes GH-7009.
2021-06-14 10:32:36 +02:00
Nikita Popov
805471e86b Fix bug #81112: Implement JsonSerializable for SplFixedArray
This returns an array for SplFixedArray JSON encoding, which
is more appropriate than an object with integer string keys.

Closes GH-7117.
2021-06-14 10:07:45 +02:00
Joe Watkins
16d499ac55
Merge branch 'phpdbg-no-remote'
* phpdbg-no-remote:
  The remote functionality is not being used. It significantly complicates current code and makes it harder to add new features.

  This commit drops all remote related functionality.
2021-06-13 22:11:29 +02:00
deltragon
ae9f6e7a8f
Add IntlDatePatternGenerator (#6771)
Add IntlDatePatternGenerator class per RFC https://wiki.php.net/rfc/intldatetimepatterngenerator.
2021-06-10 12:36:38 +02:00
Ben Morss
81f6d36c90 Add avif support to ext/gd
This backports avif support from upstream libgd into bundled libgd
and exposes the functionality through new imagecreatefromavif()
and imageavif() functions.

Closes GH-7026.

Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
2021-06-10 12:32:30 +02:00
David Carlier
fc147ed8db
sockets exposing TC_DEFER_ACCEPT to optimise tcp exchanges. 2021-06-09 06:54:02 +02:00
David Carlier
95a9e558b6
Pull #6989 FreeBSD defines SO_ACCEPTFILTER 2021-05-31 11:40:20 +02:00
David Carlier
28382aa1ec
pcntl: Adding pcntl_rfork support. 2021-05-31 09:19:15 +02:00
Máté Kocsis
01775fa104
Declare tentative return types for ext/mysqli (#6998) 2021-05-26 17:29:58 +02:00
Joe Watkins
4d883a0eba
note in upgrading for b227a72285 2021-05-21 16:05:56 +02:00
Máté Kocsis
532c60cb92
Add support for tentative return types of internal methods
RFC: https://wiki.php.net/rfc/internal_method_return_types

Closses GH-6971
2021-05-14 15:55:25 +02:00
Nikita Popov
959e5787bd Disable -a mode without readline
To avoid confusing, as -a without readline is not actually
interactive.

Discussion: https://externals.io/message/114426

Closes GH-6976.
2021-05-14 12:10:46 +02:00
Nikita Popov
6d5c60e945 Add UPGRADING/NEWS for full_path for file uploads
[ci skip]
2021-05-14 11:47:14 +02:00
Máté Kocsis
32aff25ceb
Convert resources to objects in ext/pgsql
Closes GH-6791

Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
2021-05-11 00:09:30 +02:00
Ayesh Karunaratne
57a635c655 Move resource-object classes of PSpell to \PSpell namespace
[namespaces in bundled extensions](https://wiki.php.net/rfc/namespaces_in_bundled_extensions) changes for PSpell.

 - Rename `PSpell` class to `\PSpell\Dictionary`
 - Rename `PSpellConfig` class to `\PSpell\Config`
 - Add entries to `UPGRADING` file.

Related: bd12c94f
2021-05-10 19:29:54 +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
Ayesh Karunaratne
e0b947a8da
Move resource-object classes of LDAP to \LDAP namespaces (#6963)
Another change as per accepted [namespaces in bundled extensions RFC](https://wiki.php.net/rfc/namespaces_in_bundled_extensions).

Related: #6925, #5945, #6960
2021-05-09 22:20:21 +02:00
Ayesh Karunaratne
68224f2a41 Move FTP extension class FTPConnection to FTP\Connection
With the [namespaces in bundled extensions RFC](https://wiki.php.net/rfc/namespaces_in_bundled_extensions) passed, renaming the new `\FTPConnection` class to `\FTP\Connection`.
This also adds an entry to `./UPGRADING` file.

Related: #6925, #5945
2021-05-08 16:40:10 +02:00
P.I.E. Security Team
9b794f8e5e
Expose libsodium's Ristretto255 API (#6922) 2021-05-07 17:43:00 -05:00
Ben Ramsey
01ce8d3a78
Add entries for new behavior of PDO_ODBC server info/version attributes 2021-05-07 16:41:26 -05:00
Ayesh Karunaratne
251da73a9a [skip-ci] Update UPGRADING file with new IMAP namespace
Followed by the bundled extension namespace RFC, #6925 updated the `IMAPConnection` class to `IMAP\Connection`.

This updates the UPGRADING file to reflect that change.
2021-05-06 20:57:56 +01:00
Kamil Tekiela
54222a6fe4
Implement mysqli_fetch_column (#6798)
* Implement mysqli_fetch_column
2021-05-01 20:11:47 +01:00
Nikita Popov
9a1da9f61f Don't use separate static variables in inherited methods
RFC: https://wiki.php.net/rfc/static_variable_inheritance

Closes GH-6719.
2021-04-28 17:08:50 +02:00
Nikita Popov
3e6b447979 Partially deprecate Serializable
If Serializable is implemented, require that __serialize() and
__unserialize() are implemented as well, else issue a deprecation
warning.

Also deprecate use of PDO::FETCH_SERIALIZE.

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

Closes GH-6494.
2021-04-28 16:55:14 +02:00
Aaron Piotrowski
c276c16b66
Implement Fibers
RFC: https://wiki.php.net/rfc/fibers

Closes GH-6875.
2021-04-26 11:07:06 -05:00
Matt Brown
6cd0b48cac Implement never return type
The never type can be used to indicate that a function never
returns, for example because it always unwinds.

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

Closes GH-6761.
2021-04-19 11:27:29 +02:00
Kamil Tekiela
45bad6474e
Mysqli bind in execute (#6271) 2021-04-14 12:52:51 +01:00
David Gebler
cbcfd86026 Add fsync() and fdatasync() functions
fsync is a straightforward wrapper around the same C function
(implemented on Windows API as _commit() with identical signature).

From the man pages:

    fsync() transfers ("flushes") all modified in-core data of (i.e.,
    modified buffer cache pages for) the file referred to by the file
    descriptor fd to the disk device (or other permanent storage
    device) so that all changed information can be retrieved even if
    the system crashes or is rebooted.  This includes writing through
    or flushing a disk cache if present.  The call blocks until the
    device reports that the transfer has completed.

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

Closes GH-6650.
2021-04-13 16:09:22 +02:00
Josh Soref
462da6e09c Fix spelling and grammar mistakes
This PR corrects misspellings identified by the check-spelling action.

The misspellings have been reported at jsoref@b6ba3e2#commitcomment-48946465

The action reports that the changes in this PR would make it happy: jsoref@602417c

Closes GH-6822.
2021-04-13 12:09:37 +02:00
George Peter Banyard
caaf2e9981 [skip-ci] Update UPGRADING documents for the new argument for fputcsv() 2021-03-29 13:55:18 +01:00
Jakub Zelenka
4ed4b64df8 Update NEWS and UPGRADING for FPM addition of pm.max_spawn_rate 2021-03-28 21:15:35 +01:00
Jakub Zelenka
661731d4f1 Upadate NEWS and UPRADING with info about FPM openmetrics format addition 2021-03-21 18:32:19 +00:00
Máté Kocsis
cd40fc3cb1
Convert resources to objects in ext/ldap
Closes GH-6770
2021-03-21 10:43:25 +01:00
Dharman
7e9f6d2a48 Deprecate OO style mysqli::get_client_info method
Deprecate passing connection object to mysqli_get_client_info()

Closes GH-6777.
2021-03-17 20:10:18 +00:00
Ilija Tovilo
d628d7e015
Add enums to UPGRADING [ci skip] 2021-03-17 19:15:35 +01:00
Dharman
5e1056edb6 Change the default error mode of mysqli
Make MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT the new mysqli
error reporting default. Explicitly call
mysqli_report(MYSQLI_REPORT_OFF) to preserve previous behavior.

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

Closes GH-6629.
2021-03-15 14:55:31 +01:00
Dharman
3dfd3558ca Deprecate mysqli driver_version property
The driver version hasn't been updated in 13 years, so this number
is essentially meaningless. Check PHP_VERSION_ID instead.
2021-03-15 10:48:36 +01:00
Dmitry Stogov
b84f4ed7c3 typo 2021-03-05 12:31:04 +03:00
Nikita Popov
500b4b4945 Explicitly print reference wrappers in debug_zval_dump()
Closes GH-6750.
2021-03-04 10:11:37 +01:00
Dmitry Stogov
c9a9362c78 Added UPGRADING note. 2021-03-01 13:42:34 +03:00
Darek Slusarczyk
da011a312a Fix #80329: Add option to specify LOAD DATA LOCAL white list folder
* allow the user to specify a folder where files that can be sent
   via LOAD DATA LOCAL can exist
 * add mysqli.local_infile_directory for mysqli
   (ignored if mysqli.allow_local_infile is enabled)
 * add PDO::MYSQL_ATTR_LOCAL_INFILE_DIRECTORY for pdo_mysql
   (ignored if PDO::MYSQL_ATTR_LOCAL_INFILE is enabled)
 * add related tests
 * fixes for building with libmysql 8.x
 * small improvement in existing tests
 * update php.ini-[development|production] files

Closes GH-6448.

Co-authored-by: Nikita Popov <nikic@php.net>
2021-02-23 09:30:46 +01:00
Anatol Belski
6055b72d0e UPGRADING: Add note about xxHash secret and fix a typo
[ci skip]

Signed-off-by: Anatol Belski <ab@php.net>
2021-02-21 13:36:28 +01:00
Nikita Popov
5d160e309e Fix static variable behavior with inheritance
When a method is inherited, the static variables will now always
use the initial values, rather than the values at the time of
inheritance. As such, behavior no longer depends on whether
inheritance happens before or after a method has been called.

This is implemented by always keeping static_variables as the
original values, and static_variables_ptr as the modified copy.

Closes GH-6705.
2021-02-18 11:18:19 +01:00
Alexander Moskalev
e727919b97 cURL: make possible to send file from buffer string
Add CURLStringFile class which works similarly to CURLFile, but
uploads a file from a string rather than a file. This avoids the
need to create a temporary file, or use of a data:// stream.

Basic usage:

    $file = new CURLStringFile($data, 'filename.txt', 'text/plain');
    curl_setopt($curl, CURLOPT_POSTFIELDS, ['file' => $file]);

Closes GH-6456.
2021-02-16 10:24:22 +01:00
Nikita Popov
b10416a652 Deprecate passing null to non-nullable arg of internal function
This deprecates passing null to non-nullable scale arguments of
internal functions, with the eventual goal of making the behavior
consistent with userland functions, where null is never accepted
for non-nullable arguments.

This change is expected to cause quite a lot of fallout. In most
cases, calling code should be adjusted to avoid passing null. In
some cases, PHP should be adjusted to make some function arguments
nullable. I have already fixed a number of functions before landing
this, but feel free to file a bug if you encounter a function that
doesn't accept null, but probably should. (The rule of thumb for
this to be applicable is that the function must have special behavior
for 0 or "", which is distinct from the natural behavior of the
parameter.)

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

Closes GH-6475.
2021-02-11 21:46:13 +01:00
Nikita Popov
27cd7a11cb Add support for string keys in array unpacking
This adds support for:

    $array1 = ['a' => 1, 'b' => 2];
    $array2 = ['b' => 3, 'c' => 4];
    $array = [...$array1, ...$array2];
    // => ['a' => 1, 'b' => 3, 'c' => 4]

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

Closes GH-6584.
2021-02-09 10:04:27 +01:00
tzmfreedom
a8dd009f23 Allow specifying sqlite3 DSN (file:/) in PDO SQLite
Closes GH-6610.
2021-01-25 14:44:56 +01:00
Darek Slusarczyk
ed24f0f201 Fix #80330: Replace language in APIs and source code/docs
Rename MYSQLI_REFRESH_SLAVE to MYSQLI_REFRESH_REPLICA in line with
upstream change in MySQL. The old name is retained for
backwards-compatibility reasons, and may be deprecated/removed in
the future.

Closes GH-6632.
2021-01-25 10:10:47 +01:00
Tyson Andre
71301f5baf Add documentation of array_is_list() to UPGRADING 2021-01-24 16:24:33 -05:00
Craig Francis
50eca61f68 Use ENT_QUOTES|ENT_SUBSTITUTE default for HTML encoding and decoding functions
htmlspecialchars() etc now use ENT_QUOTES | ENT_SUBSTITUTE rather
than ENT_COMPAT by default.

Closes GH-6583.
2021-01-18 15:45:28 +01:00
David Carlier
ebca8deaaf posix: adding freebsd specific rlimit constants
Respectively number of kqueues, pty limits per user.

Closes GH-6608.
2021-01-18 10:44:21 +01:00
Ayesh Karunaratne
3dad63b5b2 Curl: Add CURLOPT_DOH_URL option
From libcurl version 7.62.0 and later, it supports DNS-over-HTTPS with
[`CURLOPT_DOH_URL`](https://curl.se/libcurl/c/CURLOPT_DOH_URL.html) option.
This adds integration with the `CURLOPT_DOH_URL` option if libcurl version
is >= 7.62.0 (0x073E00).

For reference, Ubuntu 20.04+ `libcurl4-openssl-dev`-based PHP builds use Curl 7.68.

Closes GH-6612.
2021-01-18 10:00:31 +01:00
Anatol Belski
7703b85428 UPGRADING: Add xxHash notes [ci skip]
Signed-off-by: Anatol Belski <ab@php.net>
2021-01-09 21:50:46 +01:00
Nikita Popov
3c68f38fda Restrict allowed usages of $GLOBALS
This restricts allowed usage of $GLOBALS, with the effect that
plain PHP arrays can no longer contain INDIRECT elements.

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

Closes GH-6487.
2021-01-06 12:46:24 +01:00
George Peter Banyard
589bdf30b2 Implement Explicit octal notation for integers RFC
RFC: https://wiki.php.net/rfc/explicit_octal_notation

Add an extensive test suits for other variants of integer literals

Closes GH-6360
2021-01-04 21:09:23 +01:00
Nikita Popov
438b025a28 Support native types in PDO SQLite
Return integers and floats as native types if possible. As usual,
the old behavior can be restored by enabling ATTR_STRINGIFY_FETCHES.

Fixes bug #38334.
2020-12-23 11:25:31 +01:00
Nikita Popov
caa710037e Rewrite PDO result binding
Instead of requiring the type to be determined in advance by the
describer function and then requiring get_col to return a buffer
of appropriate type, allow get_col to return an arbitrary zval.
See UPGRADING.INTERNALS for a more detailed description of the
change.

This makes the result fetching simpler, more efficient and more
flexible. The general possibility already existed via the special
PDO_PARAM_ZVAL type, but the usage was very inconvenient and/or
inefficient. Now it's possible to easily implement behavior like
"return int if it fits, otherwise string" and to avoid any kind
of complex management of temporary buffers.

This also fixes bug #40913 (our second highest voted bug of all
time, for some reason). PARAM_LOB result bindings will now
consistently return a stream resource, independently of the used
database driver.

I've tried my best to update all PDO drivers for this change, but
some of the changes may be broken, as I cannot test or even build
some of these drivers (in particular PDO dblib and PDO oci).
Fixes are appreciated -- a working CI setup would be even more
appreciated ;)
2020-12-22 15:56:34 +01:00
George Peter Banyard
27afc455c3 Add IMAP resource to object conversion to UPGRADING 2020-12-22 03:09:00 +01:00
Nikita Popov
737195c3ae PDO: Honor ATTR_STRINGIFY_FETCHES for booleans
Of the important PDO drivers, this affects only PDO PgSQL, as
both MySQL and SQLite do not return native boolean types.
2020-12-21 15:32:32 +01:00
Christoph M. Becker
b85f0d1cd0 Convert file_info resources to objects
Besides our general desire to get rid of the legacy resource types,
this is particularly appealing for fileinfo, because there are already
respective objects.

Closes GH-5987.
2020-12-20 18:19:22 +01:00
Nikita Popov
037512cfce Move fetch_all implementation out of mysqlnd
There doesn't seem to be any compelling reason to implement this
in mysqlnd rather than mysqli. It's just a loop over fetch_into.

This makes the function available under libmysqlclient as well,
and thus fixes bug #79372.
2020-12-18 12:27:30 +01:00
Nikita Popov
c18b1aea28 PDO MySQL: Use native types for results
Previously, PDO MySQL only fetched data as native int/float if
native prepared statements were used. This patch updates PDO to
have the same behavior for emulated prepared statements, and thus
removes the largest remaining discrepancy between these two modes.

Note that PDO already has a ATTR_STRINGIFY_FETCHES option to control
whether native types are desired or not. The previous output can
be restored by enabling this option.

Most of the tests make use of that option, because this allows the
tests to work under libmysqlclient as well, which currently always
returns string results (independently of whether native or emulated
PS are used).
2020-12-17 10:54:34 +01:00
Nikita Popov
33e904915e MySQLnd: Clean up and optimize mysqlnd result set handling
This is a larger overhaul of the mysqlnd result set infrastructure:

 * Drop support for two different types of buffered results sets
   ("c" and "zval"). Possibly these made sense at some earlier
   time, but now (with minor adjustments) one option is strictly
   worse than the other. Buffered result sets already buffer the
   full row packets, from which zvals can be decoded. The "zval"
   style additionally also buffered the decoded zvals. As result
   sets, even buffered ones, are generally only traversed once,
   this just ends up wasting memory. Now, a potentially useful
   variation here would be to buffer the decoded zvals instead of
   the row packets, but that's not what the code was doing.
 * To make it really strictly better, pre-allocate the zval row
   buffer and reuse it for all rows. Previously the "c" style always
   allocated a new buffer for each row.
 * The fetch_row API now provides a populated zval[]. The task of
   populating an array is deferred to fetch_row_into, which also
   avoids duplicating this code in multiple places. The fetch_row_c
   API is also implemented on top of fetch_row now, rather than
   duplicating large parts of the code.
 * The row fetching code for prepared statements and normal result
   sets has been mostly merged. These already used the same
   infrastructure, but prepared statements used separate row
   fetching functions that were nearly the same as the normal ones.
   This requires passing the stmt into the result set, rather than
   just a flag. The only part that remains separate is reading of
   unbuffered results in the presence of PS cursors.
2020-12-17 10:15:02 +01:00
Nikita Popov
890e4caf0b Drop support for max_length in mysqli_fetch_fields()
Retain the field, but always populate it with zero. This was
already the case for PS without length updating.

max_length has nothing lost in the field metadata -- it is a
property of the specific result set, and requires scanning the
whole result set to compute. PHP itself never uses max_length
with mysqlnd, it is only exposed in the raw mysqli API.

Keeping it for just that purpose is not worthwhile given the costs
involved. People who actually need this for some reason can easily
calculate it themselves, while making it obvious that the
calculation requires a full result set scan.
2020-12-17 10:01:02 +01:00
Christoph M. Becker
2b7eb0e26a Disallow version_compare() $operator abbreviations
`version_compare()` does a sloppy check for the `$operators` argument
which allows arbitrary abbreviations of the supported operators to be
accepted.  This is both undocumented and unexpected, and could lead to
subtle BC breaks, if the order of the comparisions will be changed.
Therefore we change to strict comparisons.

Closes GH-6510.
2020-12-13 23:55:33 +01:00
Anatol Belski
c6d3c68fb4 UPGRADING: Document algorithm specific hash options [ci skip]
Signed-off-by: Anatol Belski <ab@php.net>
2020-12-13 16:46:32 +01:00
Nikita Popov
7965bc3656 Use pkg-config for libargon2
We already tried this in PHP 7.4, but ran into issues, because
alpine did not support pkg-config for libargon2 (or had a broken
pc file, not sure). The Alpine issue has been resolved in the
meantime, so let's give this another try.
2020-11-24 11:52:43 +01:00
Jakub Zelenka
c3a6debc08 Bump minimal OpenSSL version to 1.0.2 2020-11-01 20:10:37 +00:00
Anatol Belski
347a3f8736 UPGRADING: Add murmurhash note [ci skip]
Signed-off-by: Anatol Belski <ab@php.net>
2020-10-31 19:19:00 +01:00
Christoph M. Becker
521c36c855 Remove IGNORE_URL_WIN macro
This macro is defined to zero as of PHP 5.0.0, and as the comment
indicates, is no longer relevant.  Thus, we remove the definition and
all usages from the core and bundled extensions.

Closes GH-6351.
2020-10-18 23:36:36 +02:00
Gabriel Caruso
14806e0824
Prepare for PHP 8.1
Closes GH-6305.
2020-10-09 11:37:27 +02:00
Remi Collet
107962208a add note about is_callable change 2020-10-03 07:27:08 +02:00
Nikita Popov
d7243ce291 Add UPGRADING note for substr() behavior
[ci skip]
2020-10-02 09:41:05 +02:00
Côme Chilliet
550a4f2fa8 Remove deprecated functions from php-ldap
Remove ldap_control_paged_result and ldap_control_paged_result_response
 which have been deprecated in PHP 7.4, in favor of new $controls
 parameters for ldap request functions.
2020-10-01 10:15:27 +02:00
Remi Collet
e39ce172f8 bump zip extension version 2020-09-29 16:17:23 +02:00
Christoph M. Becker
47a166c837 Fix #78792: zlib.output_compression disabled by Content-Type: image/
Disabling output compression for images has served to fix bug #16109,
where zlib compressed images apparently have caused issues with
Navigator 4.  This shouldn't be an issue with somewhat contemporary
browsers.  Other than that, this is an arbitrary restriction – why
don't we disable the compression for some other media types as well
(e.g. video/* and audio/*)?  All in all, we should leave that decision
to userland.

Closes GH-6198.
2020-09-29 11:30:06 +02:00
Christoph M. Becker
9f5a77188c Fix #22986: odbc_connect() may reuse persistent connection
`odbc_connect()` should not reuse persistent connections, since that
prohibits multiple concurrent connections, which are occasionally
desireable.  We fix that by no longer looking for already cached
connections when `odbc_connect()` is called, and instead creating a new
connection instead.

Closes GH-6223.
2020-09-29 11:20:41 +02:00
zeriyoshi
060fde4377 Add call_user_func_array() backward incompatible change
Closes GH-6218.

[ci skip]
2020-09-29 10:44:57 +02:00
Máté Kocsis
9b50fd2626
Fix UNKNOWN default values in ext/odbc
Closes GH-6154
2020-09-24 22:17:04 +02:00
Alex Dowad
4222ae16e7 SplFixedArray is Aggregate, not Iterable
One strange feature of SplFixedArray was that it could not be used in nested foreach
loops. If one did so, the inner loop would overwrite the iteration state of the outer
loop.

To illustrate:

    $spl = SplFixedArray::fromArray([0, 1]);
    foreach ($spl as $a) {
      foreach ($spl as $b) {
        echo "$a $b";
      }
    }

Would only print two lines:

    0 0
    0 1

Use the new InternalIterator feature which was introduced in ff19ec2df3 to convert
SplFixedArray to an Aggregate rather than Iterable. As a bonus, we get to trim down
some ugly code! Yay!
2020-09-23 08:33:24 +02:00
George Peter Banyard
5d7d5e2773 Add proper default values for optional arguments in IMAP
Closes GH-6179
2020-09-22 17:46:28 +01:00
Nikita Popov
8ff2f2f84b Return empty array for no rows in pg_fetch_all()
This makes it line up with pg_fetch_all_columns(), as well as
similar functions in other exts, such as mysqli_fetch_all().
2020-09-21 17:22:02 +02:00
Nikita Popov
7300f6fc17 Deprecate pgsql function aliases
These have been documentation-deprecated for a very long time,
make it official.
2020-09-21 11:33:05 +02:00
Nikita Popov
5cb8b04646 Drop support for libmysqlclient < 5.5
Given how little maintenance the libmysqlclient driver sees, be
more aggressive in dropping old version support here.
2020-09-17 12:05:30 +02:00
Máté Kocsis
46d22e435f
Change int parameter types to bool when the parameter behaves as bool
Closes GH-6148
2020-09-17 09:38:18 +02:00
Nikita Popov
9a6c22da70 Remove deprecated pgsql signatures
As the comment indicates, these are deprecated in PHP 4.2...
2020-09-09 15:50:30 +02:00
Nikita Popov
3ab88831ae Remove deprecated multi-parameter form of pg_connect() 2020-09-09 12:31:00 +02:00
Nikita Popov
73ab7b30ca Allow array_diff() and array_intersect() with single array argument
Both of these functions are well-defined when used with a single
array argument -- rejecting this case was an artificial limitation.
This is not useful when called with explicit arguments, but removes
edge-cases when used with argument unpacking:

    // OK even if $excludes is empty.
    array_diff($array, ...$excludes);

    // OK even if $arrays contains a single array only.
    array_intersect(...$arrays);

This matches the behavior of functions like array_merge() and
array_push(), which also allow calls with no array or a single
array respectively.

Closes GH-6097.
2020-09-09 11:03:17 +02:00
Máté Kocsis
9975986b7e
Improve error messages mentioning parameters instead of arguments
Closes GH-5999
2020-09-09 10:47:43 +02:00
Nikita Popov
3e14942756 Require $method parameter in openssl_seal/openssl_open
RC4 is considered insecure, and it's not possible to change the
default of these functions. As such, require the method to be
passed explicitly.

Closes GH-6093.
2020-09-08 14:21:01 +02:00
Nikita Popov
032f862133 Drop support for crypt() without explicit salt
crypt() without salt generates a weak $1$ MD5 hash. It has been
throwing a notice since 2013 and we provide a much better alternative
in password_hash() (which can auto-generate salts for strong
password hashes), so keeping this is just a liability.
2020-09-07 15:43:26 +02:00
Benjamin Eberlei
842be67b60 Update NEWS, UPGRADING 2020-09-02 20:32:52 +02:00
Christoph M. Becker
e6044d4455 Fix #55847: DOTNET .NET 4.0 GAC new location
If we do not specify the exact version of the .NET framework to use,
the default CLR is loaded, which is typically CLR 2, which is very old.
Therefore, we introduce a `PHP_INI_SYSTEM` setting, which allows users
to choose the desired .NET framework version.  The value of the setting
are the first three parts of the framework's version number, separated
by dots, and prefixed with "v", e.g. "v4.0.30319".  If the value of the
INI setting is `NULL` (the default) or an empty string, the default CLR
is used.

Internally, we switch from the most generic `CoCreateInstance()` to
`CorBindToRuntime()` which is implemented in mscoree.dll.  To avoid the
hard dependency to that library, we load dynamically.

So this fix is supposed to be fully backwards compatible.

Closes GH-5949
2020-08-22 12:42:34 +02:00
Christopher Jones
ff66e4945e OCI8 classes were already renamed in 8; this now follows the new-new standard 2020-08-21 17:46:16 +10:00
Tyson Andre
9883fec99f Fix more basic function stubs
User-defined functions can't have multiple parameters with the same name.
Don't do that for var_dump/debug_zval_dump.

Consistently use array $array to match docs

Fix typo in UPGRADING

Fixes GH-6015
2020-08-18 20:23:42 -04:00
Christoph M. Becker
4514afc187 Fix #79988: new reserved keyword match is a backward incompatible change 2020-08-18 12:39:18 +02:00