Skip to content

PHP_VERSION conditional is not recognized #201

Open
@cmb69

Description

@cmb69

Consider the following script:

<?php

if (PHP_VERSION >= '5') {
    md5('foo', true);
}

The second parameter to md5() is only available as of PHP 5.0.0, but the call is guarded by a respective check based on PHP_VERSION. Unfortunately, phpcompatinfo-4.2.0.phar analyser:run . reports:

Requires PHP 5.0.0 (min), PHP 5.0.0 (all)

In my opinion, checking for PHP_VERSION should be generally avoided (preferring a feature test instead), but when it comes to newly introduced parameters there might not be an alternative. It would be great if PHP CompatInfo could catch at least those cases where PHP_VERSION is compared to a literal (most likely comparing to a variable isn't possible to check at all).

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions