PEAR logo

PHP_CompatInfo : The Definitive Guide

Name

PHP_CompatInfo::loadVersion — Load components list

Synopsis

    require_once 'PHP/CompatInfo.php';
   
array PHP_CompatInfo::loadVersion( $min,  
  $max = FALSE,  
  $include_const = FALSE,  
  $groupby_vers = FALSE);  
string   $min;
string|boolean   $max = FALSE;
boolean   $include_const = FALSE;
boolean   $groupby_vers = FALSE;

Description

Load components list for a PHP version or subset

Parameter

string $min

PHP minimal version

string|boolean $max

(optional) PHP maximal version

boolean $include_const

(optional) include constants list in final result

boolean $groupby_vers

(optional) give initial php version of function or constant

Return value

returns An array of php function available in version(s) given

returns A mixed array of php function + php constants available in version(s) given. Available with parameter #3 ($include_const) since API 1.6.0

Throws

throws no exceptions thrown

Since

since version 1.2.0 (2006-08-23)

Note

This function can not be called statically.

Example

What's new with PHP version 4.3.10 ?

  1. <?php
  2. require_once 'PHP/CompatInfo.php';
  3.  
  4. $pci = new PHP_CompatInfo();
  5. $res = $pci->loadVersion('4.3.10', '4.3.10', true);
  6. var_export($res);
  7. ?>

Result give: 0 function and 2 constants

array (
  'functions' =>
  array (
  ),
  'constants' =>
  array (
    0 => 'PHP_EOL',
    1 => 'UPLOAD_ERR_NO_TMP_DIR',
  ),
)
   

What's new since PHP version 5.2.1 ?

  1. <?php
  2. require_once 'PHP/CompatInfo.php';
  3.  
  4. $pci = new PHP_CompatInfo();
  5. $res = $pci->loadVersion('5.2.1');
  6. var_export($res);
  7. ?>

Result give 24 functions

array (
  0 => 'cachingiterator::count',
  1 => 'directoryiterator::getbasename',
  2 => 'imagegrabscreen',
  3 => 'imagegrabwindow',
  4 => 'ming_setswfcompression',
  5 => 'mysql_set_charset',
  6 => 'openssl_pkcs12_export',
  7 => 'openssl_pkcs12_export_to_file',
  8 => 'openssl_pkcs12_read',
  9 => 'php_ini_loaded_file',
  10 => 'reflectionextension::info',
  11 => 'regexiterator::setpregflags',
  12 => 'splfileinfo::getbasename',
  13 => 'splfileinfo::getlinktarget',
  14 => 'splfileinfo::getrealpath',
  15 => 'splobjectstorage::serialize',
  16 => 'splobjectstorage::unserialize',
  17 => 'stream_is_local',
  18 => 'stream_socket_shutdown',
  19 => 'swfmovie::namedanchor',
  20 => 'swfmovie::protect',
  21 => 'swfmovie::remove',
  22 => 'sys_get_temp_dir',
  23 => 'tidynode::getparent',
)
   
PHP_CompatInfo : The Definitive Guide v 1.8.0 : August 1, 2008