Skip to content

Memcached SASL support is assumed to be always true #6263

@paulbalandan

Description

@paulbalandan

Bug report

Code snippet that reproduces the problem

Using PHPStan v1.3.0, it assumes that all memcached installations have SASL support.

https://phpstan.org/r/21ec5d0c-0f4e-499c-87ee-9b842a8ce5e6 (using the constant Memcached::HAVE_SASL)
https://phpstan.org/r/ccb205ad-89bb-4af1-b3e9-2330603d3a8e (using the method check on Memcached::setSaslAuthData)

Expected output

Previously on versions before 1.3.0, adding the constant name (Memcached::HAVE_SASL) on the dynamicConstantNames parameter in phpstan.neon clears the error away. However, starting on 1.3.0, the error will become Strict comparison between 0 and false will always evaluate to false. This only happens on machines with ext-memcached installed. On Windows, there's no error. Disabling the RuntimeReflectionProvider does not help either.

For the method_exists error, this is my first time encountering this error in a bid to go away with the constant name but I suppose it also errors.

Did PHPStan help you today? Did it make you happy in any way?

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