1--TEST--
2php_ini_scanned_files() function
3--FILE--
4<?php
5    $inifile = __DIR__.DIRECTORY_SEPARATOR.'loaded.ini';
6    $php = sprintf('%s -c %s', getenv('TEST_PHP_EXECUTABLE_ESCAPED'), escapeshellarg($inifile));
7    $scandir = __DIR__.DIRECTORY_SEPARATOR.'scandir';
8
9    // Empty env value disables any config option
10    putenv('PHP_INI_SCAN_DIR=');
11    passthru($php.' -r "var_dump(php_ini_scanned_files());"');
12
13    // Env value without path separator overrides any config option
14    putenv('PHP_INI_SCAN_DIR='.$scandir);
15    passthru($php.' -r "var_dump(php_ini_scanned_files());"');
16
17    // Scanned ini values override previously loaded values
18    passthru($php.' -r "var_dump(ini_get(\'date.timezone\'));"');
19?>
20--EXPECTREGEX--
21bool\(false\)
22string\(\d+\) ".*[\/\\]0\.ini
23"
24string\(\d+\) "Antarctica\/McMurdo"
25