Decent Dabbler
Decent Dabbler

Reputation: 22773

ZipArchive::filename, how is it supposed to work?

I thought ZipArchive::filename would represent the path to the actual zip file, but for every zip file I open with ZipArchive::open(), ZipArchive::filename gives me an empty string.

Example:

$zip = new ZipArchive();
$zip->open( '/some/path/to/zipfile.zip' );
var_dump( $zip->filename );

// expecting:
string(25) "/some/path/to/zipfile.zip"

// but getting:
string(0) ""

Am I misunderstanding ZipArchive::filename, or using it incorrectly perhaps?

Using PHP 5.2.6 on Apache, Windows XP here.

Upvotes: 2

Views: 1826

Answers (1)

Einacio
Einacio

Reputation: 3532

in the changelog for 5.2.9 "Fixed zip filename property read."

try updating your php version

Upvotes: 3

Related Questions