Skip to content

[BUG]: Dangling Comma In Partial Argument List #17652

Description

@kgrammer

This is not really a BUG as much as coding consistency issue.

PHP and JavaScript allow the last elements in an array list to have a comma.

[ 'something1' => 1, 'something2' => 2,]

If you accidentally code using that same muscle-memory process when creating a VOLT partial argument list, VOLT throws a syntax error.

For example, this code works.

{{ partial('page/display-course-buttons', ['size': 'large', 'course': course]) }}

While this producing "Syntax error, unexpected token ]..."

{{ partial('page/display-course-buttons', ['size': 'large', 'course': course, ]) }}

It's worth considering if the dangling comma SHOULD throw an error.

Activity

  1. added
    bug
    on Oct 2, 2026
  2. self-assigned this
    on Oct 3, 2026
  3. added
    new feature request
    5.0
    and removed
    bug
    on Oct 3, 2026
  4. added theissue type on Oct 3, 2026
  5. niden commented on Oct 7, 2026

    @niden
    SponsorMember

    The same gap exists with argument lists.

    I am going to defer this to v7, It is a parser fix and there are a few lined up there.

  6. added this to Phalcon v7 and removed this from Phalcon v5on Oct 7, 2026
  7. added and removed
    5.0
    on Oct 7, 2026
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