3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Test{ const AB♥ = "alphabet"; } $rc = new ReflectionClass("Test"); $t = array_keys( $rc->getConstants())[0]; if ( mb_substr($t,-1,1,"utf-8") == "\xe2\x99\xa5" ) { var_dump($t,mb_substr($t,-1,1,"utf-8"), "\xe2\x99\xa5"); echo "heart: ",json_decode('"' . "\u2665" . '"'); //trigger_error("heart symbol is disallowed",E_USER_ERROR); }
based on Ktko1
Output for 5.4.1 - 7.3.0beta1
string(5) "AB♥" string(3) "♥" string(3) "♥" heart: ♥
Output for 5.3.18 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/QqOMi on line 4
Process exited with code 255.