PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » PHP » PHP_Compat » Bug #3103

loadVersion show Failed opening required 'Compat/Components.php' in php 4.0.6

Details

Request #3103loadVersion show Failed opening required 'Compat/Components.php' in php 4.0.6
Submitted2005-01-05 09:09 UTC
Fromzhang_jian at vip dot citiz dot net
StatusClosed
PackagePHP_Compat
PHP Version4.0.6
OSlinux
Roadmaps(Not assigned)

Comments

[2005-01-05 09:09 UTC] zhang_jian at vip dot citiz dot net

Description:
------------
Fatal error: Failed opening required 'Compat/Components.php'

and the code
$res[$component] = PHP_Compat::$loadfunc($component);
cause php 4.0.6 parse error

// $Id: Compat.php,v 1.17 2004/11/23 09:25:40 aidan Exp $

Reproduce code:
---------------
//require_once 'Compat/Components.php';
require_once 'PHP/Compat/Components.php';

and

//$res[$component] = PHP_Compat::$loadfunc($component);
eval("\$res[$component] = PHP_Compat::$loadfunc($component);");

[2005-01-06 03:01 UTC] zhang_jian at vip dot citiz dot net

parse error in php 4.0.6

[2005-01-06 05:53 UTC] zhang_jian at vip dot citiz dot net

I'm sorry for my poor english..

Reproduce code:
---------------
require_once('PHP/Compat.php');
$res = PHP_Compat::loadVersion('5.0.2');
print_r($res);

Expected result:
----------------
Array
(
[array_diff_key] => 1
[array_diff_ukey] => 1
[array_intersect_key] => 1
[array_intersect_ukey] => 1
)
Actual result:
--------------
Parse error: parse error, expecting `T_STRING' in /work/libs/PHP/Compat.php on line 110

so, I use eval("\$res[$component] = PHP_Compat::$loadfunc($component);");

Actual result:
--------------
Fatal error: Failed opening required 'Compat/Components.php' (include_path='.:/work/libs/:/usr/local/lib/php') in /work/libs/PHP/Compat.php on line 98

use
require_once 'PHP/Compat/Components.php';

Actual result:
--------------
Array
(
[array_diff_key] => 1
[array_diff_ukey] => 1
[array_intersect_key] => 1
[array_intersect_ukey] => 1
)

[2005-01-07 04:21 UTC] zhang_jian at vip dot citiz dot net

fixed in CVS version v1.18,thx. loadversion is a good idea :)