php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #76084 Phar::isCompressed always returning False
Submitted: 2018-03-12 16:11 UTC Modified: 2018-03-12 16:24 UTC
From: bonnevillessei67 at hotmail dot com Assigned:
Status: Not a bug Package: PHAR related
PHP Version: Irrelevant OS: Windows 10
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: bonnevillessei67 at hotmail dot com
New email:
PHP Version: OS:

 

 [2018-03-12 16:11 UTC] bonnevillessei67 at hotmail dot com
Description:
------------
Running:
Windows 10
WAMP 3.0.8
PHP 7.0.10
Apache 2.4.23
After compression of Phar file, method Phar::isCompressed() always returns FALSE.

Searched and scoured all previous bug reports. This is a new bug.

Test script:
---------------
    $phar1 = new Phar('myphar.zip.phar');
    var_dump($phar1->isCompressed());
    $phar2 = new Phar('myuncompressed.tar.phar');
	$phar2['x.txt']='my x';
    var_dump($phar2->isCompressed());
    $phar2->compress(Phar::GZ);
    var_dump($phar2->isCompressed() == Phar::GZ);

Expected result:
----------------
bool(false)
bool(false)
bool(true)

Actual result:
--------------
bool(false)
bool(false)
bool(false)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-03-12 16:24 UTC] requinix@php.net
-Status: Open +Status: Not a bug -Package: Documentation problem +Package: PHAR related
 [2018-03-12 16:24 UTC] requinix@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

Phar::compress() creates a new Phar.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 01 22:01:36 2025 UTC