Predefined Constants

The constants below are defined by this extension, and will only be available when the extension has either been compiled into PHP or dynamically loaded at runtime.

Phar compression constants
ConstantValueDescription
Phar::NONE (int) 0x00000000no compression
Phar::COMPRESSED (int) 0x0000F000bitmask that can be used with file flags to determine if any compression is present
Phar::GZ (int) 0x00001000zlib (gzip) compression
Phar::BZ2 (int) 0x00002000bzip2 compression
Phar file format constants
ConstantValueDescription
Phar::PHAR (int) 1phar file format
Phar::TAR (int) 2tar file format
Phar::ZIP (int) 3zip file format
Phar signature constants
ConstantValueDescription
Phar::MD5 (int) 0x0001signature with md5 hash algorithm
Phar::SHA1 (int) 0x0002signature with sha1 hash algorithm
Phar::SHA256 (int) 0x0003signature with sha256 hash algorithm (requires hash extension)
Phar::SHA512 (int) 0x0004signature with sha512 hash algorithm (requires hash extension)
Phar::OPENSSL (int) 0x0010signature with OpenSSL public/private key pair. This is a true, asymmetric key signature.
Phar::OPENSSL_SHA256 (int)   
Phar::OPENSSL_SHA512 (int)   
Phar webPhar mime override constants
ConstantValueDescription
Phar::PHP (int) 0used to instruct the mimeoverrides parameter of Phar::webPhar() that the extension should be parsed as a PHP file
Phar::PHPS (int) 1used to instruct the mimeoverrides parameter of Phar::webPhar() that the extension should be parsed as a PHP source file through highlight_file()
To Top