Testing constants\n";
$passed = true;
$php_constants = (new \ReflectionClass($class))->getConstants();
$emulation_constants = (new \ReflectionClass("MRBS\Intl\\$class"))->getConstants();
foreach ($php_constants as $name => $value)
{
// We are only interested in public constants
if (!(new \ReflectionClassConstant($class, $name))->isPublic())
{
continue;
}
if (!isset($emulation_constants[$name]))
{
$passed = false;
echo "Failed to find constant $name ($value)
\n";
}
else if ($value != $emulation_constants[$name])
{
$passed = false;
echo "Constant $name has different value in PHP ($value) and MRBS ($emulation_constants[$name])
\n";
}
}
if ($passed)
{
echo "Passed
\n";
}
}
function thead_html(array $arg_names) : string
{
$html = "\n";
$html .= '';
$html .= '| function | ';
foreach ($arg_names as $arg_name)
{
$html .= '$' . escape_html($arg_name) . ' | ';
}
$html .= 'Result - PHP | Result - MRBS | Summary | ';
$html .= "
\n";
$html .= "
\n";
return $html;
}