Page MenuHomePhabricator

xhpast not support the php 5.4 syntax of array defined with bracket
Closed, WontfixPublic

Description

I got error when genertate php symbols using scripts/symbols/generate_php_symbols.php

EXCEPTION: (XHPASTSyntaxErrorException) XHPAST Parse Error: syntax error, unexpected '[' on line 48
at [path/to/phabricator/phabricator/libphutil/src/parser/xhpast/api/XHPASTTree.php:62]

The code is like this:

$array = ['foo','bar'];

Event Timeline

iodragon raised the priority of this task from to High.
iodragon updated the task description. (Show Details)
iodragon added projects: XHPAST, Phabricator.
iodragon added a subscriber: iodragon.
epriestley claimed this task.

Because Phabricator targets PHP 5.2, we haven't gotten around to adding support for PHP 5.4+ features. See discussion here:

https://github.com/facebook/libphutil/issues/28

Also related:

https://secure.phabricator.com/T635
https://secure.phabricator.com/T1261