Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • Not that I'm aware.. And why would you want to? Javascript is so limited in comparison? Objects should be described properly, and with scope and hinting, etc. Commented Jan 18, 2009 at 20:11
  • 1
    any chance you can change the accepted answer on this one? the answer to this question has changed in the last 6 years. :) Commented Jul 18, 2015 at 21:01
  • *shorthand is always one word though. Commented May 13, 2021 at 3:19
  • I came here looking for "PHPON" (PHP object notation), which would be a PHP equivalent of JSON, and which I would find handy. Apparently it doesn't exist. Anyway, I found that using var_export($var) returns what I needed, even if it's not the most compact form. So this may be off-topic, sorry, but in case it's useful to someone... I'm leaving this comment. Feel free to tell me or downgrade me or ask me to delete this if it's a bad comment. Commented Nov 24, 2022 at 15:21
  • Does this answer your question? PHP object literal Commented Apr 2, 2023 at 18:29