<?php $p = new Phar('/path/to/my.phar', 0, 'my.phar'); try { // deletes file.txt from my.phar by calling offsetUnset unset($p['file.txt']); } catch (Exception $e) { echo 'Could not delete file.txt: ', $e; }?>