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 property dynamically is not working #625

Closed
aschwin opened this issue Nov 12, 2014 · 4 comments
Closed

Setting property dynamically is not working #625

aschwin opened this issue Nov 12, 2014 · 4 comments

Comments

@aschwin
Copy link

aschwin commented Nov 12, 2014

I use this code:

    public function __set(string! name, value)
    {
        let this->_sourceObject->{name} = value;
    }

This is in the top of my class:

protected this->_sourceObject = null;

Further, I want to use the ReflectionClass to use many types of objects. I can imagine setting _sourceObject to null is a problem since Zephir compiles it and doesn't know much about PHP using this dynamically. Any hints how to avoid this is welcome.

The error I get is:

Zephir\ParseException: Syntax error in /vagrant/project/project/object/Interrogator.zep on line 47

            let this->_sourceObject->{name};
    --------------------------------^
@steffengy
Copy link
Contributor

Probably a duplicate of #573

@aschwin
Copy link
Author

aschwin commented Nov 12, 2014

Thanks @steffengy. Sorry, that I didn't find the duplicate myself.

@dreamsxin
Copy link
Contributor

@andresgutierrez Zephir processing power for the context should be strengthened

@nkt
Copy link
Contributor

nkt commented Dec 8, 2014

Duplicate of #573.

@nkt nkt closed this as completed Dec 8, 2014
@nkt nkt added the duplicate label Dec 8, 2014
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

4 participants