Skip to content

Full PHP 8.6 support: deprecations, API types and capabilities - #14413

Merged
danog merged 22 commits into
vimeo:masterfrom
danog:php86-deprecations
Nov 21, 2026
Merged

danog merged 22 commits into
vimeo:masterfrom
danog:php86-deprecations

Conversation

@danog

@danog danog commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Builtins PHP 8.6 deprecates

Deprecated functions, methods and constants are not reported, whatever the analysed PHP version.

Before

<?php
$a = is_double(1.0);

After

$a = is_double(1.0); // DeprecatedFunction: The function is_double is deprecated since PHP 8.6, use is_float() instead

Builtins PHP 8.1 to 8.5 deprecate

Before

<?php
$a = utf8_encode("a");

After

$a = utf8_encode("a"); // DeprecatedFunction: The function utf8_encode is deprecated since PHP 8.2, use mb_convert_encoding() instead

Syntax PHP 8.1 to 8.5 deprecates

Before

<?php
function f(stdClass $a = null): void {}

After

function f(stdClass $a = null): void {} // DeprecatedSyntax: Making the type of $a nullable with its null default is deprecated since PHP 8.4, declare the type nullable

Syntax PHP 8.6 deprecates

return in finally, and the other deprecated declarations, are not reported.

Before

<?php
function f(): int {
    try {
        return 1;
    } finally {
        return 2;
    }
}

After

        return 2; // DeprecatedSyntax: A return in a finally block is deprecated since PHP 8.6

Poll API types

The watcher a poll context returns loses the types of its handle and data.

Before

<?php
use Io\Poll\{Context, Event};

$poll = new Context();
$watcher = $poll->add(new StreamPollHandle(STDIN), [Event::Read], 42); // Io\Poll\Watcher
$data = $watcher->getData(); // mixed

After

$watcher = $poll->add(new StreamPollHandle(STDIN), [Event::Read], 42); // Io\Poll\Watcher<StreamPollHandle, 42>
$data = $watcher->getData(); // 42

Partial application of a function with several signatures

Before

<?php
$versions = ['8.4', '8.5', '8.6'];
$supported = array_filter($versions, version_compare(?, '8.6', '>=')); // MixedArgumentTypeCoercion

After

$supported = array_filter($versions, version_compare(?, '8.6', '>=')); // array<int<0, 2>, '8.4'|'8.5'|'8.6'>

Polyfills of native functions

A polyfill replaces the signature of a function native in the analysed PHP version (grapheme_strrev() is mixed with symfony/polyfill-intl-grapheme installed).

Before

<?php
// with a polyfill of stream_last_errors() returning string
$a = stream_last_errors(); // string

After

$a = stream_last_errors(); // list<StreamError>

Polyfills Psalm itself requires

Psalm's own symfony/polyfill-php84/86 defined functions and classes for the analysed project.

Before (--php-version=8.3, project without the polyfills)

<?php
array_find([1], fn(int $x): bool => $x > 0); // no issue
clamp(5, 0, 10); // no issue
echo RoundingMode::HalfEven->name; // no issue

After

array_find([1], fn(int $x): bool => $x > 0); // UndefinedFunction
clamp(5, 0, 10); // UndefinedFunction
echo RoundingMode::HalfEven->name; // UndefinedClass: RoundingMode is not defined for the analysed PHP version 8.3

Classes PHP 8.3 to 8.5 add

Before (PHP 8.5 runtime)

<?php
function f(Uri\Rfc3986\Uri $c): void {} // no issue at --php-version=8.4

/** @psalm-pure */
function rfc3986(string $s): ?string {
    $uri = Uri\Rfc3986\Uri::parse($s); // ImpureMethodCall: The context is pure but method Uri\Rfc3986\Uri::parse requires impure
    // ...
}

After

function f(Uri\Rfc3986\Uri $c): void {} // UndefinedClass: Uri\Rfc3986\Uri is not defined for the analysed PHP version 8.4 (it was introduced in PHP 8.5)
    $uri = Uri\Rfc3986\Uri::parse($s); // no issue

Randomness and the impure functions PHP 8.1 to 8.5 add

Before

<?php
/** @psalm-pure */
function hashPassword(string $password): string {
    return password_hash($password, PASSWORD_DEFAULT); // no issue
}

/** @psalm-pure */
function body(): array {
    return request_parse_body(); // ImpureFunctionCall: ... requires impure
}

After

    return password_hash($password, PASSWORD_DEFAULT); // ImpureFunctionCall
    return request_parse_body(); // ImpureFunctionCall: ... function call on request_parse_body requires io

__sleep() and __wakeup(), which PHP 8.5 soft-deprecates

Before

<?php
final class A {
    public function __wakeup(): void {} // no issue
}

After

    public function __wakeup(): void {} // DeprecatedSyntax: Declaring __wakeup() is deprecated since PHP 8.5, use __unserialize() instead

String increments and decrements PHP 8.3 deprecates

Before

<?php
$a = "";
$a++; // StringIncrement: Incrementing a non-numeric string is deprecated since PHP 8.5, use str_increment() instead

function previous(string $id): void {
    $id--; // InvalidOperand: Cannot perform a numeric operation with a non-numeric type string
}

After

$a++; // StringIncrement: Incrementing an empty string is deprecated since PHP 8.3
    $id--; // StringIncrement: Decrementing a non-numeric string is deprecated since PHP 8.3, as it has no effect

Deprecated global constants

Before

<?php
namespace Foo;

#[\Deprecated(since: "2.0")]
const OLD = 1;
echo \Foo\OLD; // no issue

After

echo \Foo\OLD; // DeprecatedConstant: Constant Foo\OLD is deprecated

Overrides of typed class constants

Before

<?php
class Base {
    public const int LIMIT = 10;
}

final class Child extends Base {
    public const int LIMIT = 20; // InvalidClassConstantType: The type "20" for Child::LIMIT does not satisfy the type "10" inherited from Base::LIMIT
}

After

    public const int LIMIT = 20; // no issue

https://claude.ai/code/session_0134ww6vqixM8wK7okgxnEvo

- builtin functions, methods and constants PHP deprecates (is_double(),
  ArrayIterator::asort(), SORT_LOCALE_STRING, ...) as DeprecatedFunction,
  DeprecatedMethod and DeprecatedConstant, saying since when and what to use
- deprecated arguments: an object for an array (array_walk(),
  http_build_query(), ...), define()'s third argument, is_a() with a class
  name, a session handler without create_sid() and validateId(), more than 16
  php://filter filters, mysqli_stmt without a query
- the names PHP 8.6 reserves (let, is, _, readonly) as ReservedWord
- DeprecatedSyntax: return in finally, a value returned or yielded by a
  constructor or destructor, a nullable __debugInfo(), a class constant named
  namespace

Also give a partial application of a callmap function with several
signatures the one the arguments fit, and type stream_last_errors().
…hods

- Io\Poll\Watcher is generic in its handle and data, which Context::add()
  keeps; StreamException::getErrors() and stream_last_errors() return
  list<StreamError>
- capabilities of the new classes (poll API, builders, IntlNumberRangeFormatter,
  Openssl\Session, ...) and of the new functions with side effects (random
  sodium keys and nonces, XOF states, stream errors, snmp settings)
- the new methods of ReflectionParameter, ReflectionProperty,
  ReflectionAttribute, mysqli and ZipArchive, which a class dated by an older
  @SInCE no longer makes available before PHP 8.6
- a polyfill no longer replaces the signature of a function native in the
  analysed version (grapheme_strrev() was mixed with
  symfony/polyfill-intl-grapheme installed)
- the stub images use the PHP 8.6 release, with the extensions the release
  candidates couldn't build
- require symfony/polyfill-php86
@danog danog added the release:feature The PR will be included in 'Features' section of the release notes label Nov 20, 2026
The syntax lint keeps the oldest supported PHP, which it checks the code parses on.

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

✅ Performance: regressed · Types: increased

Project Memory (MB) Wall (s) Issues Weighted (types) Taint
✅ laravel 1 757 $\color{gray}{\textsf{-0.6\%}}$ 96.8 $\color{gray}{\textsf{+0.3\%}}$ 25 936 $\color{red}{\textsf{+9}}$ $\color{green}{\textsf{-1}}$ 53 541 $\color{red}{\textsf{+22}}$ 682
✅ symfony 3 600 $\color{gray}{\textsf{-0.2\%}}$ 206.5 $\color{gray}{\textsf{+1.7\%}}$ 50 639 $\color{red}{\textsf{+40}}$ $\color{green}{\textsf{-8}}$ 98 508 $\color{red}{\textsf{+106}}$ 1 528
✅ doctrine-orm 381 $\color{gray}{\textsf{-3.1\%}}$ 21.1 $\color{gray}{\textsf{-1.2\%}}$ 3 481 $\color{red}{\textsf{+15}}$ $\color{green}{\textsf{-14}}$ 6 143 $\color{green}{\textsf{-18}}$ 0
✅ psl 617 $\color{gray}{\textsf{-2.5\%}}$ 27.3 $\color{gray}{\textsf{-1.0\%}}$ 1 375 $\color{red}{\textsf{+76}}$ $\color{gray}{\textsf{-0}}$ 5 615 $\color{red}{\textsf{+160}}$ 1
✅ phpunit 455 $\color{gray}{\textsf{-3.6\%}}$ 15.7 $\color{gray}{\textsf{-1.1\%}}$ 1 744 3 459 18
✅ php-parser 226 $\color{gray}{\textsf{-4.9\%}}$ 10.3 $\color{gray}{\textsf{-5.0\%}}$ 17 132 $\color{gray}{\textsf{+0}}$ $\color{green}{\textsf{-1}}$ 21 025 $\color{green}{\textsf{-10}}$ 0
✅ tempest 895 $\color{gray}{\textsf{-1.3\%}}$ 27.6 $\color{gray}{\textsf{-0.4\%}}$ 5 048 $\color{red}{\textsf{+3}}$ $\color{gray}{\textsf{-0}}$ 10 557 $\color{red}{\textsf{+6}}$ 242
✅ amphp-amp 68 $\color{red}{\textsf{+9.0\%}}$ 1.5 $\color{green}{\textsf{-18.4\%}}$ re-run 29 49 0
✅ webmozarts-assert 272 $\color{green}{\textsf{-5.7\%}}$ 3.5 $\color{green}{\textsf{-16.3\%}}$ re-run 578 2 724 0
✅ guzzle-promises 44 $\color{green}{\textsf{-22.0\%}}$ 1.2 $\color{green}{\textsf{-33.5\%}}$ re-run 155 $\color{red}{\textsf{+1}}$ $\color{gray}{\textsf{-0}}$ 434 $\color{red}{\textsf{+7}}$ 2
✅ monolog 135 $\color{green}{\textsf{-12.2\%}}$ 4.2 $\color{green}{\textsf{-12.3\%}}$ re-run 913 $\color{red}{\textsf{+10}}$ $\color{gray}{\textsf{-0}}$ 2 479 $\color{red}{\textsf{+76}}$ 10
✅ drupal 4 841 $\color{gray}{\textsf{-0.2\%}}$ 192.4 $\color{gray}{\textsf{+2.2\%}}$ 97 589 $\color{red}{\textsf{+64}}$ $\color{green}{\textsf{-1}}$ 169 294 $\color{red}{\textsf{+182}}$ 583
Total 13 291 $\color{gray}{\textsf{-1.0\%}}$ 608.1 $\color{gray}{\textsf{+0.7\%}}$ 204 619 $\color{red}{\textsf{+218}}$ $\color{green}{\textsf{-25}}$ 373 828 $\color{red}{\textsf{+531}}$ 3 066
How to read this table
  • Memory: Psalm's own peak figure, threads=1. More than +5 % fails, unless the PR changes composer.json.
  • Wall: base and head run on the same runner; ±10 % is noise. Above +20 % warns, never fails. re-run: a reversed second run was taken and the faster kept.
  • Issues: head count over all categories, then $\color{red}{\textsf{+added}}$ $\color{green}{\textsf{-removed}}$ against base.
  • Weighted (types): type issues weighted by error level (levels 1–8 as is, always-errors 10, strictness checks 1). Taint and dead-code issues are not weighed. The projects' own code is pinned and their dependencies resolve identically for base and head, so a change means Psalm reports more, fewer or differently serious issues. A rise is not necessarily a regression.
  • Taint: head count of Tainted* issues, then $\color{orange}{\textsf{+added}}$ $\color{orange}{\textsf{-removed}}$ against base. Both are orange as either direction needs review: more can be new detection or false positives, fewer can be fixed false positives or lost detection.
  • Dead code: head count of unused-code issues, shown only when a run reported some (findUnusedCode). More is red, fewer is green.
  • Total: sum over the projects compared on both sides. Thresholds apply per project, not to the total.
  • Colors: $\color{red}{\textsf{red}}$ past a fail or warn threshold (or more issues), $\color{green}{\textsf{green}}$ an improvement past noise (or fewer issues), $\color{orange}{\textsf{orange}}$ needs review, $\color{gray}{\textsf{gray}}$ noise.
  • Performance: regressed if a head run crashed or timed out or a memory or wall delta is red, else improved if one is green, else unchanged. Its icon is the check result: ❌ fail · ⚠️ warn · ✅ pass; the icon next to each project is that project's result, 💥 = not comparable: base crashed or timed out (counts as ⚠️).
  • Types (heading): direction of the total weighted change, increased · decreased · unchanged. Taint and Dead code (heading): added and removed counts, present only when non-zero. Informational, never fails the check.
✅ laravel: issues +9 −1

Memory 1 768 → 1 757 MB (−0.6 %) · Wall 96.6 → 96.8 s (+0.3 %)

Weighted 53 519 → 53 541 (+22, +0.04 %): L2 +8 · L4 −1 · always +1

Issue type added removed
DeprecatedConstant 1 0
DeprecatedFunction 1 0
DeprecatedSyntax 6 0
InvalidStaticInvocation 1 0
RedundantCondition 0 1

Added (9)

  • src/Illuminate/Collections/Collection.php:1686 DeprecatedConstant (error): The constant SORT_LOCALE_STRING is deprecated since PHP 8.6, use Collator::sort() instead
  • src/Illuminate/Collections/Collection.php:1686 DeprecatedFunction (error): The function strcoll is deprecated since PHP 8.6, use Collator::compare() instead
  • src/Illuminate/Database/Eloquent/Model.php:2974 DeprecatedSyntax (error): Declaring __sleep() is deprecated since PHP 8.5, use __serialize() instead
  • src/Illuminate/Database/Eloquent/Model.php:3001 DeprecatedSyntax (error): Declaring __wakeup() is deprecated since PHP 8.5, use __unserialize() instead
  • src/Illuminate/Queue/Middleware/RateLimited.php:152 DeprecatedSyntax (error): Declaring __sleep() is deprecated since PHP 8.5, use __serialize() instead
  • src/Illuminate/Queue/Middleware/RateLimited.php:166 DeprecatedSyntax (error): Declaring __wakeup() is deprecated since PHP 8.5, use __unserialize() instead
  • src/Illuminate/Queue/Middleware/RateLimitedWithRedis.php:144 DeprecatedSyntax (error): Declaring __sleep() is deprecated since PHP 8.5, use __serialize() instead
  • src/Illuminate/Queue/Middleware/RateLimitedWithRedis.php:154 DeprecatedSyntax (error): Declaring __wakeup() is deprecated since PHP 8.5, use __unserialize() instead
  • src/Illuminate/Support/Carbon.php:12 InvalidStaticInvocation (error): Method Carbon\Traits\Creator::__construct is not static, but is called statically

Removed (1)

  • src/Illuminate/Database/Query/Builder.php:4299 RedundantCondition (error): Type non-empty-array<array-key, non-empty-string>|non-empty-string|null for $uniqueBy is always non-empty-countable
✅ symfony: issues +40 −8

Memory 3 607 → 3 600 MB (−0.2 %) · Wall 202.9 → 206.5 s (+1.7 %)

Weighted 98 402 → 98 508 (+106, +0.11 %): L1 +18 · L2 +9 · L3 −2 · L4 −1 · always +8

Issue type added removed
ArgumentTypeCoercion 3 0
DeprecatedFunction 6 0
DeprecatedMethod 2 0
DeprecatedSyntax 1 0
LessSpecificReturnStatement 0 2
MixedArgument 6 0
MixedArrayAccess 6 0
MixedArrayOffset 2 0
MixedAssignment 3 2
MixedPropertyTypeCoercion 1 0
MixedReturnStatement 2 0
MoreSpecificReturnType 0 2
PossiblyInvalidArgument 0 1
RedundantCondition 0 1
UndefinedFunction 8 0

Added (40)

  • src/Symfony/Component/ErrorHandler/Debug.php:33 DeprecatedFunction (error): Changing the ini setting assert.active is deprecated since PHP 8.3, use zend.assertions instead
  • src/Symfony/Component/ErrorHandler/Debug.php:34 DeprecatedFunction (error): Changing the ini setting assert.exception is deprecated since PHP 8.3
  • src/Symfony/Component/ErrorHandler/Exception/FlattenException.php:393 DeprecatedMethod (error): Wrapping an object in ArrayObject or ArrayIterator is deprecated since PHP 8.5, use get_object_vars() instead
  • src/Symfony/Component/HttpClient/Internal/AmpResolver.php:43 MixedReturnStatement (error): Could not infer a return type
  • src/Symfony/Component/HttpClient/Internal/AmpResolver.php:43 UndefinedFunction (error): Function Amp\Dns\resolve does not exist, consider enabling the allFunctionsGlobal config option if scanning legacy codebases
  • src/Symfony/Component/HttpClient/Internal/AmpResolver.php:59 MixedReturnStatement (error): Could not infer a return type
  • src/Symfony/Component/HttpClient/Internal/AmpResolver.php:59 UndefinedFunction (error): Function Amp\Dns\resolve does not exist, consider enabling the allFunctionsGlobal config option if scanning legacy codebases
  • src/Symfony/Component/HttpClient/Response/AmpResponse.php:216 UndefinedFunction (error): Function Amp\Future\awaitFirst does not exist, consider enabling the allFunctionsGlobal config option if scanning legacy codebases
  • src/Symfony/Component/JsonStreamer/Transformer/BcMathNumberValueObjectTransformer.php:48 ArgumentTypeCoercion (error): Argument 1 of BcMath\Number::__construct expects int|numeric-string, but parent type string provided
  • src/Symfony/Component/Messenger/Envelope.php:128 DeprecatedSyntax (error): Declaring __wakeup() is deprecated since PHP 8.5, use __unserialize() instead
  • … and 30 more

Removed (8)

  • src/Symfony/Component/EventDispatcher/EventDispatcher.php:52 RedundantCondition (error): Type array<array-key, mixed> for $this->optimized is always isset
  • src/Symfony/Component/HttpClient/Internal/AmpResolver.php:33 MoreSpecificReturnType (error): The declared return type 'non-empty-list<Amp\Dns\DnsRecord>' for Symfony\Component\HttpClient\Internal\AmpResolver::resolve is more specific than the inferred return type 'array<array-key, mixed>'
  • src/Symfony/Component/HttpClient/Internal/AmpResolver.php:43 LessSpecificReturnStatement (error): The type 'array<array-key, mixed>' is more general than the declared return type 'non-empty-list<Amp\Dns\DnsRecord>' for Symfony\Component\HttpClient\Internal\AmpResolver::resolve
  • src/Symfony/Component/HttpClient/Internal/AmpResolver.php:49 MoreSpecificReturnType (error): The declared return type 'non-empty-list<Amp\Dns\DnsRecord>' for Symfony\Component\HttpClient\Internal\AmpResolver::query is more specific than the inferred return type 'array<array-key, mixed>'
  • src/Symfony/Component/HttpClient/Internal/AmpResolver.php:59 LessSpecificReturnStatement (error): The type 'array<array-key, mixed>' is more general than the declared return type 'non-empty-list<Amp\Dns\DnsRecord>' for Symfony\Component\HttpClient\Internal\AmpResolver::query
  • src/Symfony/Component/HttpClient/Response/AmpResponse.php:216 PossiblyInvalidArgument (error): Argument 1 of Amp\Future\awaitFirst expects iterable<mixed, Amp\Future<mixed>>, but possibly different type list{0: Amp\Future<'_0:string>, 1?: mixed, ...<mixed>} provided
  • src/Symfony/Component/Messenger/Execution/ParallelExecutionStrategy.php:166 MixedAssignment (error): Unable to determine the type that $response is being assigned to
  • src/Symfony/Component/Messenger/Execution/ParallelExecutionStrategy.php:327 MixedAssignment (error): Unable to determine the type that $response is being assigned to
✅ doctrine-orm: issues +15 −14

Memory 393 → 381 MB (−3.1 %) · Wall 21.3 → 21.1 s (−1.2 %)

Weighted 6 161 → 6 143 (−18, −0.29 %): L2 +14 · L4 −14 · always +1

Issue type added removed
DeprecatedSyntax 14 0
RedundantCondition 0 14
UndefinedClass 1 0

Added (15)

  • src/Mapping/AssociationMapping.php:334 DeprecatedSyntax (error): Declaring __sleep() is deprecated since PHP 8.5, use __serialize() instead
  • src/Mapping/ClassMetadata.php:735 DeprecatedSyntax (error): Declaring __sleep() is deprecated since PHP 8.5, use __serialize() instead
  • src/Mapping/DefaultTypedFieldMapper.php:46 UndefinedClass (error): BcMath\Number is not defined for the analysed PHP version 8.1 (it was introduced in PHP 8.4); define a polyfill (symfony/polyfill-php84 ships some of the symbols of that version), or raise the analysed PHP version
  • src/Mapping/DiscriminatorColumnMapping.php:71 DeprecatedSyntax (error): Declaring __sleep() is deprecated since PHP 8.5, use __serialize() instead
  • src/Mapping/EmbeddedClassMapping.php:77 DeprecatedSyntax (error): Declaring __sleep() is deprecated since PHP 8.5, use __serialize() instead
  • src/Mapping/FieldMapping.php:143 DeprecatedSyntax (error): Declaring __sleep() is deprecated since PHP 8.5, use __serialize() instead
  • src/Mapping/InverseSideMapping.php:23 DeprecatedSyntax (error): Declaring __sleep() is deprecated since PHP 8.5, use __serialize() instead
  • src/Mapping/JoinColumnMapping.php:62 DeprecatedSyntax (error): Declaring __sleep() is deprecated since PHP 8.5, use __serialize() instead
  • src/Mapping/JoinTableMapping.php:114 DeprecatedSyntax (error): Declaring __sleep() is deprecated since PHP 8.5, use __serialize() instead
  • src/Mapping/ManyToManyOwningSideMapping.php:213 DeprecatedSyntax (error): Declaring __sleep() is deprecated since PHP 8.5, use __serialize() instead
  • … and 5 more

Removed (14)

  • src/Mapping/Driver/XmlDriver.php:170 RedundantCondition (error): Type SimpleXMLElement for $xmlRoot->indexes is always isset
  • src/Mapping/Driver/XmlDriver.php:213 RedundantCondition (error): Type SimpleXMLElement for $xmlRoot->unique-constraints is always isset
  • src/Mapping/Driver/XmlDriver.php:307 RedundantCondition (error): Type SimpleXMLElement for $idElement->generator is always isset
  • src/Mapping/Driver/XmlDriver.php:364 RedundantCondition (error): Type SimpleXMLElement for $oneToOneElement->join-columns is always isset
  • src/Mapping/Driver/XmlDriver.php:415 RedundantCondition (error): Type SimpleXMLElement for $oneToManyElement->order-by is always isset
  • src/Mapping/Driver/XmlDriver.php:466 RedundantCondition (error): Type SimpleXMLElement for $manyToOneElement->join-columns is always isset
  • src/Mapping/Driver/XmlDriver.php:550 RedundantCondition (error): Type SimpleXMLElement for $manyToManyElement->order-by is always isset
  • src/Mapping/Driver/XmlDriver.php:576 RedundantCondition (error): Type SimpleXMLElement for $xmlRoot->attribute-overrides is always isset
  • src/Mapping/Driver/XmlDriver.php:588 RedundantCondition (error): Type SimpleXMLElement for $xmlRoot->association-overrides is always isset
  • src/Mapping/Driver/XmlDriver.php:595 RedundantCondition (error): Type SimpleXMLElement for $overrideElement->join-columns is always isset
  • … and 4 more
✅ psl: issues +76 −0

Memory 632 → 617 MB (−2.5 %) · Wall 27.6 → 27.3 s (−1.0 %)

Weighted 5 455 → 5 615 (+160, +2.93 %): L2 +75 · always +1

Issue type added removed
DeprecatedConstant 2 0
DeprecatedFunction 73 0
ImpureFunctionCall 1 0

Added (76)

  • packages/encoding/src/Psl/Encoding/EncodedWord/Internal/encode_b_words.php:29 DeprecatedFunction (error): The mbstring encoding BASE64 is deprecated since PHP 8.2, use base64_encode() instead
  • packages/encoding/src/Psl/Encoding/EncodedWord/Internal/encode_b_words.php:29 DeprecatedFunction (error): The mbstring encoding HTML-ENTITIES is deprecated since PHP 8.2, use htmlspecialchars() or mb_encode_numericentity() instead
  • packages/encoding/src/Psl/Encoding/EncodedWord/Internal/encode_b_words.php:29 DeprecatedFunction (error): The mbstring encoding Quoted-Printable is deprecated since PHP 8.2, use quoted_printable_encode() instead
  • packages/encoding/src/Psl/Encoding/EncodedWord/Internal/encode_b_words.php:29 DeprecatedFunction (error): The mbstring encoding UUENCODE is deprecated since PHP 8.2, use convert_uuencode() instead
  • packages/encoding/src/Psl/Encoding/EncodedWord/Internal/encode_q_words.php:27 DeprecatedFunction (error): The mbstring encoding BASE64 is deprecated since PHP 8.2, use base64_encode() instead
  • packages/encoding/src/Psl/Encoding/EncodedWord/Internal/encode_q_words.php:27 DeprecatedFunction (error): The mbstring encoding HTML-ENTITIES is deprecated since PHP 8.2, use htmlspecialchars() or mb_encode_numericentity() instead
  • packages/encoding/src/Psl/Encoding/EncodedWord/Internal/encode_q_words.php:27 DeprecatedFunction (error): The mbstring encoding Quoted-Printable is deprecated since PHP 8.2, use quoted_printable_encode() instead
  • packages/encoding/src/Psl/Encoding/EncodedWord/Internal/encode_q_words.php:27 DeprecatedFunction (error): The mbstring encoding UUENCODE is deprecated since PHP 8.2, use convert_uuencode() instead
  • packages/http-message/src/Psl/HTTP/Message/reason_phrase.php:57 DeprecatedConstant (error): Constant Psl\HTTP\Message\STATUS_USE_PROXY is deprecated
  • packages/http-message/src/Psl/HTTP/Message/reason_phrase.php:98 DeprecatedConstant (error): Constant Psl\HTTP\Message\STATUS_NOT_EXTENDED is deprecated
  • … and 66 more
✅ php-parser: issues +0 −1

Memory 237 → 226 MB (−4.9 %) · Wall 10.8 → 10.3 s (−5.0 %)

Weighted 21 035 → 21 025 (−10, −0.05 %): always −1

Issue type added removed
DuplicateFunction 0 1

Removed (1)

  • lib/PhpParser/compatibility_tokens.php:6 DuplicateFunction (error): Method phpparser\definecompatibilitytokens has already been defined as a core function
✅ tempest: issues +3 −0

Memory 906 → 895 MB (−1.3 %) · Wall 27.7 → 27.6 s (−0.4 %)

Weighted 10 551 → 10 557 (+6, +0.06 %): L2 +3

Issue type added removed
DeprecatedFunction 3 0

Added (3)

  • packages/event-bus/src/EventBusConfig.php:42 DeprecatedFunction (error): The function spl_object_hash is deprecated since PHP 8.6, use spl_object_id() instead
  • packages/mapper/src/Casters/EnumCaster.php:59 DeprecatedFunction (error): Calling is_a() with a class name when allow_string is false is deprecated since PHP 8.6, check class_exists() first and pass true for allow_string
  • packages/support/src/Str/functions.php:861 DeprecatedFunction (error): The function metaphone is deprecated since PHP 8.6
✅ guzzle-promises: issues +1 −0

Memory 57 → 44 MB (−22.0 %) · Wall 1.9 → 1.2 s (−33.5 %)

Weighted 427 → 434 (+7, +1.64 %): L7 +1

Issue type added removed
ReservedWord 1 0

Added (1)

  • src/Is.php:10 ReservedWord (error): Naming a class Is is deprecated since PHP 8.6, as is becomes a keyword
✅ monolog: issues +10 −0

Memory 154 → 135 MB (−12.2 %) · Wall 4.8 → 4.2 s (−12.3 %)

Weighted 2 403 → 2 479 (+76, +3.16 %): L2 +3 · always +7

Issue type added removed
DeprecatedFunction 1 0
DeprecatedMethod 2 0
UndefinedAttributeClass 7 0

Added (10)

  • src/Monolog/Formatter/JsonFormatter.php:210 DeprecatedMethod (error): Wrapping an object in ArrayObject or ArrayIterator is deprecated since PHP 8.5, use get_object_vars() instead
  • src/Monolog/Formatter/NormalizerFormatter.php:242 DeprecatedMethod (error): Wrapping an object in ArrayObject or ArrayIterator is deprecated since PHP 8.5, use get_object_vars() instead
  • src/Monolog/Handler/TestHandler.php:112 UndefinedAttributeClass (error): NoDiscard is not defined for the analysed PHP version 8.1 (it was introduced in PHP 8.5); define a polyfill (symfony/polyfill-php85 ships some of the symbols of that version), or raise the analysed PHP version
  • src/Monolog/Handler/TestHandler.php:123 UndefinedAttributeClass (error): NoDiscard is not defined for the analysed PHP version 8.1 (it was introduced in PHP 8.5); define a polyfill (symfony/polyfill-php85 ships some of the symbols of that version), or raise the analysed PHP version
  • src/Monolog/Handler/TestHandler.php:142 UndefinedAttributeClass (error): NoDiscard is not defined for the analysed PHP version 8.1 (it was introduced in PHP 8.5); define a polyfill (symfony/polyfill-php85 ships some of the symbols of that version), or raise the analysed PHP version
  • src/Monolog/Handler/TestHandler.php:148 UndefinedAttributeClass (error): NoDiscard is not defined for the analysed PHP version 8.1 (it was introduced in PHP 8.5); define a polyfill (symfony/polyfill-php85 ships some of the symbols of that version), or raise the analysed PHP version
  • src/Monolog/Handler/TestHandler.php:157 UndefinedAttributeClass (error): NoDiscard is not defined for the analysed PHP version 8.1 (it was introduced in PHP 8.5); define a polyfill (symfony/polyfill-php85 ships some of the symbols of that version), or raise the analysed PHP version
  • src/Monolog/Handler/TestHandler.php:187 UndefinedAttributeClass (error): NoDiscard is not defined for the analysed PHP version 8.1 (it was introduced in PHP 8.5); define a polyfill (symfony/polyfill-php85 ships some of the symbols of that version), or raise the analysed PHP version
  • src/Monolog/Handler/TestHandler.php:83 UndefinedAttributeClass (error): NoDiscard is not defined for the analysed PHP version 8.1 (it was introduced in PHP 8.5); define a polyfill (symfony/polyfill-php85 ships some of the symbols of that version), or raise the analysed PHP version
  • src/Monolog/Utils.php:256 DeprecatedFunction (error): The function utf8_encode is deprecated since PHP 8.2, use mb_convert_encoding() instead
✅ drupal: issues +64 −1

Memory 4 852 → 4 841 MB (−0.2 %) · Wall 188.2 → 192.4 s (+2.2 %)

Weighted 169 112 → 169 294 (+182, +0.11 %): L2 +56 · always +7

Issue type added removed
DeprecatedConstant 11 0
DeprecatedFunction 9 0
DeprecatedSyntax 37 0
InvalidStaticInvocation 7 0
RedundantConditionGivenDocblockType 0 1

Added (64)

  • core/lib/Drupal/Component/DependencyInjection/ReverseContainer.php:93 DeprecatedFunction (error): The function spl_object_hash is deprecated since PHP 8.6, use spl_object_id() instead
  • core/lib/Drupal/Core/Block/Plugin/Block/PageTitleBlock.php:20 InvalidStaticInvocation (error): Method Drupal\Core\Block\BlockPluginTrait::__construct is not static, but is called statically
  • core/lib/Drupal/Core/Cache/MemoryBackend.php:218 DeprecatedSyntax (error): Declaring __sleep() is deprecated since PHP 8.5, use __serialize() instead
  • core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:359 DeprecatedSyntax (error): Declaring __sleep() is deprecated since PHP 8.5, use __serialize() instead
  • core/lib/Drupal/Core/Config/StorageComparer.php:508 DeprecatedSyntax (error): Declaring __sleep() is deprecated since PHP 8.5, use __serialize() instead
  • core/lib/Drupal/Core/Config/StorageComparer.php:515 DeprecatedSyntax (error): Declaring __wakeup() is deprecated since PHP 8.5, use __unserialize() instead
  • core/lib/Drupal/Core/Database/Connection.php:1308 DeprecatedSyntax (error): Declaring __sleep() is deprecated since PHP 8.5, use __serialize() instead
  • core/lib/Drupal/Core/Database/Query/Query.php:86 DeprecatedSyntax (error): Declaring __sleep() is deprecated since PHP 8.5, use __serialize() instead
  • core/lib/Drupal/Core/Database/Query/Query.php:95 DeprecatedSyntax (error): Declaring __wakeup() is deprecated since PHP 8.5, use __unserialize() instead
  • core/lib/Drupal/Core/Database/Transaction.php:44 DeprecatedSyntax (error): Declaring __wakeup() is deprecated since PHP 8.5, use __unserialize() instead
  • … and 54 more

Removed (1)

  • core/lib/Drupal/Core/TypedData/Plugin/DataType/BinaryData.php:44 RedundantConditionGivenDocblockType (error): Docblock-defined type string for $this->uri is always isset

composer.json changed in this PR, so head dependencies were re-resolved; memory and time deltas are informational.

head b1c5c8a · base 419de43 (merge-base) · workflow run

The return in finally, constructor and destructor, __debugInfo, name and
argument checks run where Psalm already analyses those statements, instead of
in a separate traversal and a separate call analyzer.
Functions, methods, constants, class constants, properties, ini settings and
mbstring encodings PHP 8.1 to 8.5 deprecate, the argument shapes they deprecate,
and the language deprecations: Serializable without __serialize(), static members
accessed on a trait, optional parameters before required ones, implicitly nullable
parameters, by-reference void returns, __sleep() not returning an array, "${var}"
interpolation, relative callables, raising 0 to a negative power, a class named _,
non-canonical casts, the backtick operator, case ending with a semicolon,
$http_response_header and __debugInfo() returning null. SID is a string.
The negated types of a ternary include the clauses that held before it, which
the context already applied: an elseif after count($a) > 2 reported
$a[0] ?? null as never has-at-least-3.
@danog

danog commented Nov 21, 2026

Copy link
Copy Markdown
Collaborator Author

bugbot review

@danog
danog force-pushed the php86-deprecations branch from 759857f to 9dcd5ee Compare November 21, 2026 00:06

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 759857f. Configure here.

danog added 13 commits November 21, 2026 01:46
A function defined in Psalm's process, like the polyfills Psalm requires,
counted as defined for the analysed project, so on an older runtime
array_find() analysed for PHP 8.3 reported no UndefinedFunction. Such a
function now counts only if the project depends on its package other than
through Psalm, and Psalm no longer scans the autoloaded files of the other
packages.

Claude-Session: https://claude.ai/code/session_0134ww6vqixM8wK7okgxnEvo
Runtimes before their version had no definition of these classes, so code
analysed for their version reported UndefinedClass, and newer runtimes
defined them for older analysed versions. The classes get @SInCE stubs,
in PhpVersionedClasses.phpstub or their extension's stub, and the enums a
new PhpVersionedEnums.phpstub loaded from PHP 8.1. The polyfills Psalm
itself requires no longer count as the project's polyfills of a class.

Claude-Session: https://claude.ai/code/session_0134ww6vqixM8wK7okgxnEvo
…d password_hash()

The key generators taking no argument counted as impure, and the others,
like sodium_crypto_box_seal() and password_hash(), as pure. GMP's random
functions use its global random state, like mt_rand().

Claude-Session: https://claude.ai/code/session_0134ww6vqixM8wK7okgxnEvo
A class that has the replacement, __serialize() or __unserialize(), is
exempt: serialize() and unserialize() don't call the old method, and a
subclass may still call it as the parent's. A class with
@psalm-cli-only-instances is now told to declare __unserialize().

Claude-Session: https://claude.ai/code/session_0134ww6vqixM8wK7okgxnEvo
…h their version

Incrementing an empty or non-alphanumeric string and decrementing an empty
or non-numeric string are deprecated since PHP 8.3, but the first two were
reported as deprecated since PHP 8.5 and the decrements as InvalidOperand.
They are StringIncrement issues now, and a decremented string keeps the
value PHP gives it: -1 for an empty string, the same non-numeric string.

Claude-Session: https://claude.ai/code/session_0134ww6vqixM8wK7okgxnEvo
A global constant declared with @deprecated, or with the #[\Deprecated]
attribute PHP 8.5 allows on it, was used without DeprecatedConstant.

Claude-Session: https://claude.ai/code/session_0134ww6vqixM8wK7okgxnEvo
…des keep

Overriding a PHP 8.3 typed constant without a docblock type, like
const int LIMIT = 10 with const int LIMIT = 20, was reported as
InvalidClassConstantType, as the parent's inferred literal type was taken as
the contract. Aliased trait constants also lost their @SInCE version.

Claude-Session: https://claude.ai/code/session_0134ww6vqixM8wK7okgxnEvo
Functions like request_parse_body(), mysqli_execute_query(),
pg_put_copy_data() and get_error_handler() counted as pure.

Claude-Session: https://claude.ai/code/session_0134ww6vqixM8wK7okgxnEvo
…endor directory

A project with COMPOSER_VENDOR_DIR or a vendor-dir in its composer.json had
its installed.json and autoload_files.php looked for in vendor/, so none of
its packages counted as its own.

Claude-Session: https://claude.ai/code/session_0134ww6vqixM8wK7okgxnEvo
BinaryOperationTest's stand-in BcMath\Number now is the stubbed class,
analysed for PHP 8.4; a CliOnlyCallTest case declares __wakeup()
incidentally; the deprecated constant test matches any path.

Claude-Session: https://claude.ai/code/session_0134ww6vqixM8wK7okgxnEvo
@danog
danog merged commit cd22a51 into vimeo:master Nov 21, 2026
71 checks passed
alies-dev added a commit to psalm/psalm-plugin-laravel that referenced this pull request Nov 21, 2026
* build: require Psalm 7.14

- Psalm 7.14 changes what the type fixtures report (PHP deprecations, unrequired-package functions, mixed-widened templates), and the fixtures updated in this PR no longer pass on 7.13.
- Raise the floor in composer.json and in the Symfony Console job of tests.yml.

* test: give the type and emission fixtures the composer.json Psalm 7.14 needs

- Psalm 7.14 counts a vendor function as defined only if the composer.json next to the config requires its package (vimeo/psalm#14413); tests/Type and the EmissionApp fixture have none, so `now()`, `cache()`, `env()`, `trans()`, `route()` and `to_route()` became UndefinedFunction and `mixed` (22 type tests and `EmissionAppTest`).
- The type tests select a differently named `composer.fixture.json` through `COMPOSER`, which leaves the plugin's project-root detection (a `composer.json` in the working directory) untouched.

* test: expect the PHP deprecations Psalm 7.14 reports in collection callback fixtures

- `is_a($string, Class::class)` is deprecated since PHP 8.6 (DeprecatedFunction) and an implicitly nullable parameter since PHP 8.4 (DeprecatedSyntax); Psalm reports both regardless of the analysed PHP version (vimeo/psalm#14413).
- The fixtures keep those shapes because the narrowing of the two-argument `is_a()` and of a `= null` closure parameter is what they pin; the deprecation is now part of `--EXPECTF--`.

* test: pin that an unbounded template given to getOrPut() and queued() now resolves to mixed

- Psalm 7.14 no longer treats a bare template as decidably not a Closure for the `$value is callable` guard (vimeo/psalm#12672), so the result is widened with `mixed` and returning it as the template reports MixedReturnStatement; before, a possible Closure result stayed silent.
- Rename GetOrPutClosureDefaultKnownLimitation.phpt to GetOrPutClosureDefaultUnboundedTemplateTest.phpt (positive coverage) and rewrite the three stub docblocks that cited the limitation.

* test: pin the possibly-empty array-shape unpack of Paginator::fragment() as a known limitation

- Psalm 7.14 unpacks `array{0?: string}` like a `list<string>` (vimeo/psalm#14415), so the call no longer resolves both the getter and the setter branch of `fragment()`; 7.13.2 did.
- Rename PaginatorFragmentUnpackTest.phpt to PaginatorFragmentUnpackKnownLimitation.phpt and rewrite the docblocks of the stub and of RouteDomainKnownLimitation.phpt that cited the old behavior.

* test: suppress Psalm 7.14's static-call false positive on a trait constructor in the Blade taint fixture

- Psalm 7.14 analyses the synthetic constructor call for uninitialised properties as a static call on the parent's trait and reports InvalidStaticInvocation (a regression of vimeo/psalm#14413, reproducible without the plugin).
- `BladeComponentTaintTest::the_bridge_adds_no_non_taint_issue` asserts no other issue, so the fixture class suppresses it.

* fix: accept the value argument in Enumerable::when() and unless() callbacks

- Laravel's Enumerable interface docblock types the callbacks as callable($this) and $value as bool, but Conditionable calls $callback($this, $value) and accepts any value
- Psalm 7.13.2 keeps the concrete $this type in callable($this) (vimeo/psalm#14423), which surfaced the arity mismatch as InvalidScalarArgument
- Stub Enumerable::when() and unless() with the Conditionable signature

* docs: link the upstream Enumerable docblock fix from the when()/unless() stub

* test: link the filed Psalm issues from the workarounds and known limitations

- vimeo/psalm#14554 (trait constructor InvalidStaticInvocation), #14556 (array-shape unpack), #14555 (composer.json next to the config).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release:feature The PR will be included in 'Features' section of the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant