- var_dump: documentation ( source)
- strpos: documentation ( source)
- mb_substr: documentation ( source)
- array_keys: documentation ( source)
- trigger_error: documentation ( source)
<?php
class Test{ const AB♥ = "alphabet"; }
$rc = new ReflectionClass("Test");
$bad = "♥";
$key = array_keys( $rc->getConstants() );
$target = $key[ 0 ];
//php5.6: if ( mb_substr( $target, -1,1) == $bad ) {
$pos = strpos( $target, $bad );
var_dump( $pos,mb_substr( $target, $pos,1 ));
if ($pos !== FALSE) {
trigger_error( "'$bad' in '$target'" );
}