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

Compilation error on accessing dynamic properties #684

Closed
SliceOfLife opened this issue Dec 14, 2014 · 3 comments
Closed

Compilation error on accessing dynamic properties #684

SliceOfLife opened this issue Dec 14, 2014 · 3 comments
Labels
nfr New Feature Request

Comments

@SliceOfLife
Copy link

SliceOfLife commented Dec 14, 2014

The documentation says, that I can use a variable value as property name:

let someProperty = "myProperty";
let this->{someProperty} = 100;

But I can't use variable to access a property of class in array:

    public static function doSomething()
    {
        var _array, property;

        let _array = [];
        let _array["index"] = new stdClass();
        let property = "test";
        let _array["index"]->{property} = 1;
    }

Compiler throws an exception:

Zephir\ParseException: Syntax error in .../TestClass.zep on line 13

      let _array["index"]->{property} = 1;
    ----------------------^

Zephir version 0.5.9a [396cb30]

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/7005436-compilation-error-on-accessing-dynamic-properties?utm_campaign=plugin&utm_content=tracker%2F280146&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F280146&utm_medium=issues&utm_source=github).
@steffengy
Copy link
Contributor

Probably related to some limitations like here: #573

@SliceOfLife
Copy link
Author

Yes, you are right.

@sergeyklay
Copy link
Member

This issue was moved to zephir-lang/php-zephir-parser#15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
nfr New Feature Request
Projects
None yet
Development

No branches or pull requests

4 participants