1--TEST-- 2Phar: attempt to create a Phar with relative path 3--EXTENSIONS-- 4phar 5--INI-- 6phar.require_hash=0 7phar.readonly=0 8--FILE-- 9<?php 10chdir(__DIR__); 11try { 12 $p = new Phar('phar_create_in_cwd.phar'); 13 $p['file1.txt'] = 'hi'; 14 var_dump(strlen($p->getStub())); 15 $p->setStub("<?php 16spl_autoload_register(function(\$class) { 17 include 'phar://' . str_replace('_', '/', \$class); 18}); 19Phar::mapPhar('phar_create_in_cwd.phar'); 20include 'phar://phar_create_in_cwd.phar/startup.php'; 21__HALT_COMPILER(); 22?>"); 23 var_dump($p->getStub()); 24} catch (Exception $e) { 25 echo $e->getMessage() . "\n"; 26} 27?> 28--CLEAN-- 29<?php 30unlink(__DIR__ . '/phar_create_in_cwd.phar'); 31?> 32--EXPECTF-- 33int(6641) 34string(%d) "<?php 35spl_autoload_register(function($class) { 36 include 'phar://' . str_replace('_', '/', $class); 37}); 38Phar::mapPhar('phar_create_in_cwd.phar'); 39include 'phar://phar_create_in_cwd.phar/startup.php'; 40__HALT_COMPILER(); ?> 41" 42