xref: /PHP-8.4/ext/phar/tests/phar_running.phpt (revision 74859783)
1--TEST--
2Phar: Phar::running()
3--EXTENSIONS--
4phar
5--INI--
6phar.readonly=0
7--FILE--
8<?php
9$fname = __DIR__ . '/' . basename(__FILE__, '.php') . '.phar.php';
10$pname = 'phar://' . $fname;
11
12$phar = new Phar($fname);
13$phar['index.php'] = '<?php
14var_dump(Phar::running());
15var_dump(Phar::running(false));
16?>';
17include $pname . '/index.php';
18var_dump(Phar::running());
19?>
20--CLEAN--
21<?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
22--EXPECTF--
23string(%d) "phar://%sphar_running.phar.php"
24string(%d) "%sphar_running.phar.php"
25string(0) ""
26