1<?php
2
3$fname = dirname(__FILE__) . '/write23.phar';
4@unlink($fname);
5
6$phar = new Phar($fname);
7$phar->setStub('<?php
8$p = new Phar(__FILE__);
9var_dump(isset($p["test.txt"]), isset($p["newname"]));
10rename("phar://" . __FILE__ . "/test.txt", "phar://" . __FILE__ . "/newname");
11var_dump(isset($p["test.txt"]), isset($p["newname"]));
12echo "ok\n";
13__HALT_COMPILER();
14?>');
15$phar['test.txt'] = "<?php __HALT"."_COMPILER();";
16?>
17