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