4 ms·
define('ISEMAIL_STRING_AT' , '@'); define('ISEMAIL_STRING_BACKSLASH' , '\\'); define('ISEMAIL_STRING_DOT' , '.'); define('ISEMAIL_STRING_DQUOTE'
by puffoflogic 4y ago
define('ISEMAIL_STRING_AT' , '@');
define('ISEMAIL_STRING_BACKSLASH' , '\\');
define('ISEMAIL_STRING_DOT' , '.');
define('ISEMAIL_STRING_DQUOTE' , '"');
define('ISEMAIL_STRING_OPENPARENTHESIS' , '(');
define('ISEMAIL_STRING_CLOSEPARENTHESIS', ')');
I find it hard to believe people seriously still do this. This is satire, right?
- m0shen 4y agoIt looks like that's auto generated
- Philip-J-Fry 4y agoThat's because you're not thinking of the future when the @ symbol might change.
- boosteri 4y agoYes but defining it like this does not help much in avoidong future refactoring. The value should be loaded from a property file and/or environment variable at least
- puffoflogic 4y agoThat's absurd, you're just asking for failure unless you load it from a dedicated high,-availability microservice built on a dedicated cloud non-relational key-value store.
- WirelessGigabit 4y agoStill? That code is 6 years old.
- ashleyn 4y agoThis doesn't seem too odd to me when considering it may be a convention of writing a lexer. E.g. symbols defined not just one-to-one with ASCII characters, but may also include something like DOUBLE_EQUALS, STRING_LITERAL, NUMBER_LITERAL, etc.
- Macha 4y agoAnd in fact... define('ISEMAIL_STRING_DOUBLECOLON' , '::'); define('ISEMAIL_STRING_IPV6TAG' , 'IPv6:');
- dgb23 4y agoThis is very typical for parsers (characters) and compilers (machine/bytecode). You could do it with namespaces and `const` though to be less verbose.
- soneil 4y agoI genuinely find this useful, in scenarios where filters and regexes are likely to devolve into punctuation explosions otherwise.