Skip to content

PHP 8.4 deprecation: (double) cast in RequestVerifier.php #76

@x-dragos

Description

@x-dragos

Description

PHP 8.4 deprecated the (double) cast in favor of (float). This triggers a deprecation warning in production:

Non-canonical cast (double) is deprecated, use the (float) cast instead
in vendor/ratchet/rfc6455/src/Handshake/RequestVerifier.php on line 48

Location

src/Handshake/RequestVerifier.php, line 48:

public function verifyHTTPVersion($val): bool {
    return 1.1 <= (double)$val;
}

Fix

Replace (double) with (float):

public function verifyHTTPVersion($val): bool {
    return 1.1 <= (float)$val;
}

Reference

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions