PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » File System » File » Bug #4559

Incorrect PHP version check

Details

Submitted2005-06-08 21:31 UTC
Fromkirokomara at yahoo dot com
Assigneddufuz
StatusClosed
PackageFile
PHP Version4.3.11
OSCentOS
Roadmaps(Not assigned)

Comments

[2005-06-08 21:31 UTC] kirokomara at yahoo dot com

Description:
------------
I was looking at the source of CSV.php (CVS: $Id: CSV.php,v 1.19 2005/03/30 18:24:01 mike Exp $) to see the usage of some of the functions as they are not documented (at least I could not find the documentation) and I saw line 411:

// Set auto detect line ending for Mac EOL support if < PHP 4.3.0.
$phpver = version_compare('4.1.0', phpversion(), '<');
if ($phpver) {
$oldini = ini_get('auto_detect_line_endings');
ini_set('auto_detect_line_endings', '1');
}

In the function version_compare(), 4.1.0 should be replaced with 4.3.0 because "auto_detect_line_endings" was introduced in version 4.3.0 as stated by the comment before the function usage.

Hope this helps,
Kupo

Reproduce code:
---------------
// Set auto detect line ending for Mac EOL support if < PHP 4.3.0.
$phpver = version_compare('4.1.0', phpversion(), '<');
if ($phpver) {
$oldini = ini_get('auto_detect_line_endings');
ini_set('auto_detect_line_endings', '1');
}

Expected result:
----------------
PHP warning that there is no such configuration variable as "auto_detect_line_endings"