Commit Graph

1210 Commits

Author SHA1 Message Date
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