3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test{ const AB♥ = "alphabet"; } $rc = new ReflectionClass("Test"); //$bad = "♥"; $bad = chr(e2); $key = array_keys( $rc->getConstants() ); $target = $key[ 0 ]; $pos = strpos( $target, $bad ); var_dump( $pos,mb_substr( $target, $pos,1 )); // 5.6 if ($pos !== FALSE) { trigger_error( "'$bad' in '$target'" ); }

preferences:
39.54 ms | 402 KiB | 5 Q