If filename contains multiple dots(.), you can preserve other parts by following code (example1).
Example #1 (Expected)
<?php
$filename = "abc.xyz.tar.gz";
$p = new PharData($filename);
$exts = explode('.', $filename);
array_shift($exts);
array_pop($exts);
$ext = implode('.', $exts);
$p->decompress($ext); # result filename: abc.xyz.tar
?>
Example #2 (might be unexpected)
<?php
$filename = "abc.xyz.tar.gz";
$p = new PharData($filename);
$p->decompress($filename); # result filename: abc.tar; xyz is truncated accidentally.
?>