xref: /PHP-8.2/ext/phar/tests/phar_oo_012b.phpt (revision 74859783)
1--TEST--
2Phar object: unset file
3--EXTENSIONS--
4phar
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--CLEAN--
34<?php
35unlink(__DIR__ . '/files/phar_oo_012b.phar.php');
36__halt_compiler();
37?>
38--EXPECT--
39Exception: Write operations disabled by the php.ini setting phar.readonly
40