xref: /PHP-7.4/ext/phar/tests/phar_oo_012b.phpt (revision 26dfce7f)
1--TEST--
2Phar object: unset file
3--SKIPIF--
4<?php if (!extension_loaded('phar')) die('skip'); ?>
5--INI--
6phar.readonly=1
7phar.require_hash=0
8--FILE--
9<?php
10
11try
12{
13	$pharconfig = 0;
14
15	require_once 'files/phar_oo_test.inc';
16
17	$phar = new Phar($fname);
18	$phar->setInfoClass('SplFileObject');
19
20	$phar['f.php'] = 'hi';
21	var_dump(isset($phar['f.php']));
22	echo $phar['f.php'];
23	echo "\n";
24	unset($phar['f.php']);
25	var_dump(isset($phar['f.php']));
26}
27catch (BadMethodCallException $e)
28{
29	echo "Exception: " . $e->getMessage() . "\n";
30}
31
32?>
33===DONE===
34--CLEAN--
35<?php
36unlink(__DIR__ . '/files/phar_oo_012b.phar.php');
37__halt_compiler();
38?>
39--EXPECT--
40Exception: Write operations disabled by the php.ini setting phar.readonly
41===DONE===
42