HEX
Server: Apache
System: Linux sg241.singhost.net 2.6.32-896.16.1.lve1.4.51.el6.x86_64 #1 SMP Wed Jan 17 13:19:23 EST 2018 x86_64
User: honghock (909)
PHP: 8.0.30
Disabled: passthru,system,shell_exec,show_source,exec,popen,proc_open
Upload Files
File: //opt/cpanel/ea-php55/root/usr/share/tests/pear/Config/test/bug16724.phpt
--TEST--
Test for request #16724: lowercase constant names option
--FILE--
<?php
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'setup.php.inc';
$datasrc = dirname(__FILE__) . '/bug16724-config.php';
$root = $config->parseConfig(
    $datasrc, 'phpconstants',
    array('lowercase' => true)
);
print_r($root->toArray());
echo $root->toString('phpconstants');

//not lowercasing should still work
$config = new Config();
$root = $config->parseConfig(
    $datasrc, 'phpconstants'
);
print_r($root->toArray());
?>
--EXPECT--
Array
(
    [root] => Array
        (
            [my_config_option] => foo
            [host12_3] => foo
        )

)
define('MY_CONFIG_OPTION', 'foo');
define('HOST12_3', 'foo');
Array
(
    [root] => Array
        (
            [MY_CONFIG_OPTION] => foo
            [HOST12_3] => foo
        )

)