DEV Community

J
J

Posted on • Updated on

Have you tried out PHP programming with all symbols defined as unicode

Here is one example using Devanagari:

class लगर
{
    const इन = 'इन्फो';

    public function लग(string $म, string $लवल)
    {
        echo "[$लेवल] $मेसेज";
    }
}

(new लगर)->लग('hello', लगर::इन);
Enter fullscreen mode Exit fullscreen mode

Discussion (10)

Collapse
mt3o profile image
mt3o • Edited on

Just don't. Never.

It's a bad habit to use non-english names in any programming task. English is the standard and is clear on the naming convention.


Post censored because obviously stating that quality of code written by offshore developers is insulting, is racist.

Collapse
adhocore profile image
J Author

dont worry i havent. no one has. or ever will. could you please edit your comment and remove the last paragraph (for reasons we all know)

Collapse
mt3o profile image
mt3o

You already did wrote such code. Above, in the post. And according to Murphys law, there will be an idiot, who will use non-ascii characters, as you proposed. It's irrelevant if it is your alphabet, russian bukhvas or those shitty slavic diacritics.

Thread Thread
adhocore profile image
J Author

"trying out" and using for real stuffs is different, no?

Collapse
mt3o profile image
mt3o

Btw, it's been couple years since the name has changed, but T_PAAMAYIM_NEKUDOTAYIM is still the example of not treating the job seriously.

Collapse
biros profile image
Boris Jamot ✊ /

It could be useful to obfuscate your code :D

Collapse
devmazee2057282 profile image
dewbiez • Edited on

It's possible to use this for obfuscation, however, I'd use hashing. People can't reverse easily that way. Isn't that the whole point?

You wouldn't want some to reverse engineer your obfuscated code. So ... why not make it so they can't?

Collapse
ogfris profile image
Fris

true i'll use this idea to my php encoder software haha thanks !

Collapse
tux0r profile image
tux0r

Why?

Collapse
adhocore profile image
J Author

for coolness and fun, maybe?