xref: /PHP-8.1/ext/phar/tests/phar_oo_011b.phpt (revision 74859783)
1--TEST--
2Phar object: add 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
19    $phar['f.php'] = 'hi';
20    var_dump(isset($phar['f.php']));
21    echo $phar['f.php'];
22    echo "\n";
23}
24catch (BadMethodCallException $e)
25{
26    echo "Exception: " . $e->getMessage() . "\n";
27}
28
29?>
30--CLEAN--
31<?php
32unlink(__DIR__ . '/files/phar_oo_011b.phar.php');
33__halt_compiler();
34?>
35--EXPECT--
36Exception: Write operations disabled by the php.ini setting phar.readonly
37