2008-09-11 03:29:15 +00:00
--TEST--
Phar: bug #46032: PharData::__construct wrong memory read
--SKIPIF--
<?php if (!extension_loaded("phar")) die("skip"); ?>
<?php if (getenv('SKIP_SLOW_TESTS')) die('skip'); ?>
--FILE--
<?php
2009-07-29 10:14:04 +00:00
$a = dirname(__FILE__) .'/mytest';
2008-09-11 03:29:15 +00:00
try {
new phar($a);
} catch (exception $e) { }
var_dump($a);
try {
new phar($a);
} catch (exception $e) { }
var_dump($a);
new phardata('0000000000000000000');
?>
===DONE===
--EXPECTF--
2009-07-29 10:14:04 +00:00
%string|unicode%(%d) "%smytest"
%string|unicode%(%d) "%smytest"
2008-09-11 03:29:15 +00:00
2011-02-01 14:01:00 +00:00
Fatal error: Uncaught exception 'UnexpectedValueException' with message 'Cannot create phar '0000000000000000000', file extension (or combination) not recognised or the directory does not exist' in %sbug46032.php:%d
2008-09-11 03:29:15 +00:00
Stack trace:
2009-07-29 10:14:04 +00:00
#0 %sbug46032.php(%d): PharData->__construct('000000000000000...')
2008-09-11 03:29:15 +00:00
#1 {main}
thrown in %sbug46032.php on line %d