- var_dump: documentation ( source)
- array_keys: documentation ( source)
<?php
class Test{ const ABC♥ = "alphabet"; }
$class = new ReflectionClass("Test");
$bad_char = "♥";
$constants = $class->getConstants();
$names = array_keys($constants);
var_dump($names);
/*
for ($i = 0, $max = count($constants); $i < $max; $i++)
{
if ( mb_strpos( $constants[$i], $bad_char) !== false ) {
trigger_error( "'$bad_char' in '$constant'" );
}
} // Notice: '♥' in 'ABC♥' ...
*/