llaville / php-compatinfo

Library that find out the minimum version and the extensions required for a piece of code to run
https://llaville.github.io/php-compatinfo/7.1/
Other
373 stars 20 forks source link

Report "Required PHP 4.0.0 (min)" on short array syntax 2 #106

Closed mdesharnais closed 11 years ago

mdesharnais commented 11 years ago

This is a follow-up of issue #105.

The assignment now work:

// File test.php
<?php
$array = [];
$array = [1];
$array = [1,2];
$array = [1,2,3];
?>

The CLI tool does not report the correct required version (5.4) when encountering the short array syntax.

http://www.php.net/manual/en/migration54.new-features.php

// File test2.php
<?php
function foo($array) {
        return true;
}

foo([]);
foo([1]);
foo([1,2]);
foo([1,2,3]);
?>
$ php ~/PHP_CompatInfo-2.25.0/scripts/phpci print --reference=ALL test.php
PHP_CompatInfo DEV by Laurent Laville

.

-------------------------------------------------------------------------------
PHP COMPAT INFO REPORT SUMMARY
-------------------------------------------------------------------------------
A TOTAL OF
 1 EXTENSION 1 FUNCTION 1 CONSTANT
WERE FOUND IN 1 FILE
REQUIRED PHP 4.0.0 (MIN)
-------------------------------------------------------------------------------

Required PHP 4.0.0 (min)
llaville commented 11 years ago

Thanks for this new report.

I've uploaded a second snapshot version of 2.25 for test purpose only.

Only available by direct download at http://bartlett.laurent-laville.org/get/PHP_CompatInfo-2.25.0.tgz

mdesharnais commented 11 years ago

Working, tank you.