--TEST-- Phar::convertToPhar() with global metadata --SKIPIF-- --INI-- phar.require_hash=0 phar.readonly=0 --FILE-- setMetadata(b'hi'); $phar->stopBuffering(); var_dump($phar->isFileFormat(Phar::TAR)); var_dump(strlen($phar->getStub())); var_dump($phar->getMetadata()); $phar = $phar->convertToExecutable(Phar::TAR); var_dump($phar->isFileFormat(Phar::TAR)); var_dump($phar->getStub()); var_dump($phar->getMetadata()); $phar['a'] = 'hi there'; $phar = $phar->convertToExecutable(Phar::PHAR, Phar::GZ); var_dump($phar->isFileFormat(Phar::PHAR)); var_dump($phar->isCompressed()); var_dump(strlen($phar->getStub())); var_dump($phar->getMetadata()); copy($fname . '.gz', $fname2); $phar = new Phar($fname2); var_dump($phar->isFileFormat(Phar::PHAR)); var_dump($phar->isCompressed() == Phar::GZ); var_dump(strlen($phar->getStub())); var_dump($phar->getMetadata()); ?> ===DONE=== --CLEAN-- --EXPECT-- bool(false) int(6673) string(2) "hi" bool(true) string(60) "