asmblah / uniter

🎉 PHP in the browser and Node.js => Docs: https://phptojs.com/
https://asmblah.github.io/uniter/
Other
446 stars 42 forks source link

Adding items to array via [] #11

Closed unlight closed 10 years ago

unlight commented 10 years ago
<?php
$filters = array();
$filters[] = 1;  // PHP Parse error: syntax error, unexpected ']' in (program) on line 3
$filters[] = 2;
<?php
class A {

    private $filters = array();

    public function addFilters($x) {
        $this->filters[] = $x; // PHP Parse error: syntax error, unexpected ']' in (program) on line 7
    }
}
sstur commented 10 years ago

I noticed this too. Would be great to have a fix!

asmblah commented 10 years ago

Hi @unlight and @sstur,

Thanks for highlighting this issue. I'm hoping to find time to work through these issues very soon! Sorry for the delay.

asmblah commented 10 years ago

Hi @unlight and @sstur,

Support for array push syntax has now been added in master (https://github.com/asmblah/uniter/commit/20051cf1e8229eb766a267c40f306cbefed2e7c9 .)

Cheers!