Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting default value of typehinted argument to array using short array syntax in PHP #470

Closed
marcushat opened this issue Sep 5, 2014 · 1 comment

Comments

@marcushat
Copy link

In ST3 there is an issue with the php syntax definition. When defining the default value of an argument using the short array syntax([ ]) it highlights the array literal as invalid. It doesn't do this when using
array() instead or without typehinting the argument. Ran the code and no errors or warnings and it works as expected. Only tested on current build 3065 of ST3.

Example(code used when I discovered this):

<?php
function foo(array &$foobar= [] ) { //array literal gets highlighted
}

function foo(array &$foobar= array() ) { //this is fine
}

function foo(&$foobar= [] ) { //this is fine too
}
?>
@marcushat marcushat changed the title setting default value of argument to array using short array syntax in PHP Setting default value of typehinted argument to array using short array syntax in PHP Sep 5, 2014
@titoBouzout
Copy link
Collaborator

This issue was moved to jskinner/DefaultPackages#17

@sublimehq sublimehq locked and limited conversation to collaborators Dec 22, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants