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 #15

Open
sergeyklay opened this issue May 13, 2017 · 2 comments
Open

Compilation error on accessing dynamic properties #15

sergeyklay opened this issue May 13, 2017 · 2 comments

Comments

@sergeyklay
Copy link
Member

sergeyklay commented May 13, 2017

From @SliceOfLife on December 14, 2014 12:54

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]

Copied from original issue: zephir-lang/zephir#684

@sergeyklay
Copy link
Member Author

From @steffengy on December 14, 2014 14:54

Probably related to some limitations like here: zephir-lang/zephir#573

@sergeyklay
Copy link
Member Author

From @SliceOfLife on December 14, 2014 15:8

Yes, you are right.

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

No branches or pull requests

1 participant