/hphp/test/zend/bad/ext/phar/tests/opendir.php
http://github.com/facebook/hiphop-php · PHP · 27 lines · 27 code · 0 blank · 0 comment · 0 complexity · 310f5f4063bcf1c1e05e0b54a4c0ab71 MD5 · raw file
- <?php
- $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
- $a = new Phar($fname);
- $a['index.php'] = '<?php
- $a = opendir("dir");
- if ($a) {
- while (false !== ($e = readdir($a))) {
- echo $e;
- }
- }
- ?>';
- $a['dir/file1.txt'] = 'hi';
- $a['dir/file2.txt'] = 'hi2';
- $a['dir/file3.txt'] = 'hi3';
- $a->setStub('<?php
- Phar::interceptFileFuncs();
- set_include_path("phar://" . __FILE__);
- include "index.php";
- __HALT_COMPILER();');
- include $fname;
- echo "\n";
- opendir('phar://');
- opendir('phar://hi.phar');
- ?>
- ===DONE===
- <?php error_reporting(0); ?>
- <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'); ?>