3v4l.org

run code in 200+ PHP versions simultaneously
<?php $subusers = [" hey", " h i", " ", "wh@t"]; foreach ($subusers as $subuser) { echo "Assess \"$subuser\":\t"; if (!strlen($subuser = trim($subuser))) { echo "* Username not entered"; } elseif (!ctype_alnum($subuser)) { echo "* Username not alphanumeric"; } echo "\n"; }
based on cqQiW
Output for 5.6.38 - 7.4.0
Assess " hey": Assess " h i": * Username not alphanumeric Assess " ": * Username not entered Assess "wh@t": * Username not alphanumeric