Skip to content

Simplify strlen comparison #9385

@simonschaufi

Description

@simonschaufi

Feature Request

What do you think about this improvement?

From:

if (strlen($string) > 0) {
    return $string;
}

To:

if ($string !== '') {
    return $string;
}

This was reported from https://plugins.jetbrains.com/plugin/7622-php-inspections-ea-extended-

This could go into code quality set

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions