![]() PHP_CompatInfo : The Definitive Guide |
Table of Contents
In most case, the basic detection is enough. But sometimes, we will
need to adjust accuracy of parser to give the best result. It is
possible with $option
, the
second parameter of each parser
method. See parser
options list for details.
Suppose we have to detect which PHP version we need to run this script named "math.php"
We will use this very simple detection script.
Default output used the Array renderer (we will talk about it and other renderers later; don't be afraid if you don't know what is it yet). Here are the raw results we got on standard output :
array ( 'ignored_files' => array ( ), 'ignored_functions' => array ( ), 'ignored_extensions' => array ( ), 'ignored_constants' => array ( ), 'max_version' => '', 'version' => '4.0.0', 'extensions' => array ( 0 => 'bcmath', 1 => 'pcre', ), 'constants' => array ( ), 'tokens' => array ( ), 'cond_code' => array ( 0 => 0, ), )
It means that we need at least PHP 4.0.0 to run the "math.php" script. with two PHP extensions bcmath, pcre loaded.
PHP_CompatInfo : The Definitive Guide | v 1.8.0 : August 1, 2008 |