Progress Bar

Since version 2.12, there is a new progress bar (ALA PHPUnit).

PHP_CompatInfo 2.12.0 by Laurent Laville

....CC......................................................  60 / 128 ( 46%)
....C..C..........................................C....C.... 120 / 128 ( 93%)
.C.....C
  • each C character tell us that there is a source file with conditional code.

With version 3.2, the progress bar (ALA Symfony Console Progress Helper) is activated with the first verbose level (-v). For example :

$ phpcompatinfo -v analyser:run <SOURCE>

Renders

    3/128 [>---------------------------]   0% Elapsed: 2 secs

References

If we want to display list of references supported, here is how to do with both versions :

Version 2.26
$ phpcompatinfo list-references
Version 3.2
$ phpcompatinfo reference:list

Now, if you want to details each reference one by one identified by its name (<REF> in following examples), and got :

  • Extensions

Version 2.26
$ phpcompatinfo list --reference=ALL extensions
or
$ phpcompatinfo list-extensions --reference=ALL
Version 3.2
$ phpcompatinfo reference:list
  • Interfaces

Version 2.26
$ phpcompatinfo list --reference=ALL interfaces <REF>
or
$ phpcompatinfo list-interfaces --reference=ALL <REF>
Version 3.2
$ phpcompatinfo reference:show --interfaces <REF>
  • Classes

Version 2.26
$ phpcompatinfo list --reference=ALL classes <REF>
or
$ phpcompatinfo list-classes --reference=ALL <REF>
Version 3.2
$ phpcompatinfo reference:show --classes <REF>
  • Functions

Version 2.26
$ phpcompatinfo list --reference=ALL functions <REF>
or
$ phpcompatinfo list-functions --reference=ALL <REF>
Version 3.2
$ phpcompatinfo reference:show --functions <REF>
  • Constants

Version 2.26
$ phpcompatinfo list --reference=ALL constants <REF>
or
$ phpcompatinfo list-constants --reference=ALL <REF>
Version 3.2
$ phpcompatinfo reference:show --constants <REF>
  • INI entries

Feature not provided by version 2.26
Version 3.2
$ phpcompatinfo reference:show --ini <REF>

And if you want to filter results on PHP version, do for example :

Version 2.26
$ phpcompatinfo list --reference=ALL classes <REF> --filter-version="php_5.1.0" --filter-operator="ge"
Version 3.2
$ phpcompatinfo reference:show --classes <REF> --php=">= 5.1.0"

Print parses results

Where <SOURCE> identify the data source, directly in CompatInfo 2.26, and via the JSON configuration file in version 3.2

Version 2.26
$ phpcompatinfo print --reference=ALL --recursive <SOURCE>
or
$ phpcompatinfo print --reference=ALL --recursive --report summary <SOURCE>
Version 3.2
$ phpcompatinfo analyser:run <SOURCE>
or
$ phpcompatinfo analyser:run <SOURCE> summary

And with additionals reports :

  • extension

Version 2.26
$ phpcompatinfo print --reference=ALL --recursive --report extension <SOURCE>
Version 3.2
$ phpcompatinfo analyser:run <SOURCE> extension
  • namespace

Version 2.26
$ phpcompatinfo print --reference=ALL --recursive --report namespace <SOURCE>
Version 3.2
$ phpcompatinfo analyser:run <SOURCE> namespace
  • trait

Version 2.26
$ phpcompatinfo print --reference=ALL --recursive --report trait <SOURCE>
Version 3.2
$ phpcompatinfo analyser:run <SOURCE> trait
  • interface

Version 2.26
$ phpcompatinfo print --reference=ALL --recursive --report interface <SOURCE>
Version 3.2
$ phpcompatinfo analyser:run <SOURCE> interface
  • class

Version 2.26
$ phpcompatinfo print --reference=ALL --recursive --report class <SOURCE>
Version 3.2
$ phpcompatinfo analyser:run <SOURCE> class
  • function

Version 2.26
$ phpcompatinfo print --reference=ALL --recursive --report function <SOURCE>
Version 3.2
$ phpcompatinfo analyser:run <SOURCE> function
  • constant

Version 2.26
$ phpcompatinfo print --reference=ALL --recursive --report constant <SOURCE>
Version 3.2
$ phpcompatinfo analyser:run <SOURCE> constant
  • global

Version 2.26
$ phpcompatinfo print --reference=ALL --recursive --report global <SOURCE>
Feature not provided by version 3.2
  • condition

Version 2.26
$ phpcompatinfo print --reference=ALL --recursive --report condition <SOURCE>
Version 3.4
$ phpcompatinfo analyser:run <SOURCE> condition
  • token

Version 2.26
$ phpcompatinfo print --reference=ALL --recursive --report token <SOURCE>
Feature not provided by version 3.2
  • xml

Version 2.26
$ phpcompatinfo print --reference=ALL --recursive --report xml <SOURCE>
Feature not provided by version 3.2
  • source

Version 2.26
$ phpcompatinfo -v print --reference=ALL --report source <SOURCE>
Version 3.2
$ phpcompatinfo provider:display <SOURCE>

Caching results

  • Version 2.26 may cache results to speed-up later analysis.

  • Version 3.2 is able (optionally) to cache results only with other SAPI than CLI.

  • Version 3.3 is able to cache results on all API including CLI.