Skip to content

[NFR]: "->" Notation for Objects in Volt #17425

Description

@kgrammer

Would it be possible to support -> for object property access in Volt, either as an alternative to . or as the preferred syntax?

PHP developers are already accustomed to using -> for object properties, while Volt currently uses .. Arrays already use the familiar PHP syntax (['key']), so allowing -> for objects would make the transition between PHP and Volt more intuitive and reduce the mental context switch when moving between templates and PHP code.

I realize this would be a language-level change and may have backward compatibility considerations, but I think it would improve consistency with standard PHP syntax and make Volt feel more natural to PHP developers.

Activity

  1. added
    new feature request
    on Aug 1, 2026
  2. self-assigned this
    on Aug 1, 2026
  3. added
    5.0
    on Aug 1, 2026
  4. added theissue type on Aug 1, 2026
  5. moved this from Backlog to Active Sprint in Phalcon v5on Aug 1, 2026
  6. added and removed
    5.0
    on Aug 1, 2026
  7. added this to Phalcon v7 and removed this from Phalcon v5on Aug 1, 2026
  8. niden commented on Aug 1, 2026

    @niden
    SponsorMember

    I am putting this for consideration in v7.

    The problem is not "->" being the same as "." for objects. That is the 3 line change. The issue is the arrays, and that will require a lot more changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

7.0new feature request

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions