Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4085218
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:32:42+00:00 2026-05-20T18:32:42+00:00

PHP allows Unicode identifiers for variables, functions, classes and constants anyhow. It was certainly

  • 0

PHP allows Unicode identifiers for variables, functions, classes and constants anyhow. It was certainly intended for localized applications. Wether it’s a good idea to code an API in anything but English is debatable, but it’s undisputed that some development settings could demand it.

 $Schüssel = new Müsli(T_FRÜCHTE);

But PHP allows more than just \p{L} for identifiers. You can use virtually any Unicode character, except those from the ASCII range (e.g. : is special or \ as that’s already used as internal hack to support namespaces.)
Anyway, you could do so, and I would even consider that a workable use for fun projects:

 throw new ಠ_ಠ("told you about the disk space before");

But other than localization and amusement and decorative effects, which uses of Unicode identifiers are advisable?

For example I’m pondering this for embedding parameters into magic method names. In my case I only need to inject numeric parameters, so would get away with just the underscore:

 $what->substr_0_50->ascii("text");
  // (Let's skip the evilness discussion this time. Not quite sure
  // yet if I really want it, but the conciseness might make sense.)

But if I wanted to embed other textual parameters, I would require another unicode character. Now that’s harder to type, but if there’s one that would aid readability and convey the meaning … ?

 ->substr✉0✉50->   // doesn't look good

So, the question in this case: Which symbol makes sense as separator for mixed-in parameters in a virtual function name. — Broader meta topic: Which uses of Unicode identifiers do you know about, or would you consider okayish?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T18:32:43+00:00Added an answer on May 20, 2026 at 6:32 pm

    Which symbol makes sense as separator for mixed-in parameters in a virtual function name.

    \u2639?

    But other than localization and amusement and decorative effects, which uses of Unicode identifiers are advisable?

    The biggest hurdle after font support is going to be making the character one that can be typed. Outside of a macro or copy/paste, unicode characters are not spectacularly easy to enter. Forcing this upon others is very likely going to violate the “assume the people that work with your code after you are murderous psychopaths that know where you live” rule.

    We use unicode characters in only a few comments in our codebase, like

    // Even though this is the end of the file and we should get an implicit exit, 
    // if we don't actually expressly exit here, PHP segfaults.
    // ♫ Oh, PHP, I love you. ♫
    

    I think that falls into the “amusement and decorative” category. Or the “shoot self in head after slaughtering the php-internals team” category. Pick one.

    Anyway, this is not a good idea because it’s going to make your code hard to modify.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

PHP allows you to replace or even re-name PHP's built-in functions using functions such
Background: PHP allows providers to disable functions (directive disable_functions). So in order to get
I'm looking for a PHP extension that allows me to connect, bind/listen, send, and
I am trying to make a php login page that allows users to access
PHP allows you to send RAW HTTP headers, which must be sent before any
PHP allows me to: Hello, my name is <?php echo $name ?>, and stuff.
I'm new to PHP and was learning about PHP functions from w3schools. It said
I have a php page which allows a user to sort pieces of information
I have a PHP function that allows users to pick which categories there post
I already wrote a PHP script that allows users to upload images but I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.