3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ValidateForms{ # Min and Max values for username and passoword const MIN_USERNAME = 4; const MAX_USERNAME = 20; const MIN_PASSWORD = 8; const MAX_PASSWORD = 40; # Regex const REGEX_USERNAME = "/^[A-z0-9_]{" . self::MIN_USERNAME . "," . self::MAX_USERNAME .'}$/'; const REGEX_PASSWORD = "/^[A-z0-9_\\\*\-]{" . self::MIN_PASSWORD . "," . self::MAX_PASSWORD .'}$/'; public static $errors = array( 'username' => array(false, "Invalid username: it must have between " . self::MIN_USERNAME . " and " . self::MAX_USERNAME . " chars."), 'password' => array(false, "Invalid password: it must have between self::MIN_PASSWORD and self::MAX_PASSWORD chars and special chars.") ); } print_r(ValidateForms::$errors); ?>

preferences:
68.67 ms | 402 KiB | 5 Q