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

reference to the array #1156

Closed
hah-a opened this issue Dec 23, 2015 · 1 comment
Closed

reference to the array #1156

hah-a opened this issue Dec 23, 2015 · 1 comment

Comments

@hah-a
Copy link

hah-a commented Dec 23, 2015

Let's look at a simple example.

namespace ExtABC;

class ClassA
{
    public $abc;

    public function __construct()
    {
        let $this->abc = [1, 2, 3];
    }
}
namespace ExtABC;
use ExtABC\ClassA;

class ClassB
{
    protected $objectA;

    public function __construct()
    {
        let $this->objectA = new \ExtABC\ClassA();
        let $this->objectA->abc[0] = 4;
    }
}

I am just creating in the class ClassB an object of the class ClassA and I am reading from created object $objectA element of array $abc[0].

During compilation I get an error

Syntax error in extabc/classb on line 11

        let $this->objectA->abc[0] = 4;
--------------------------^

That is, before I read the element of array $abc I need to get a reference to the $objectA. But how to do that? Zephir has no references...

@steffengy
Copy link
Contributor

duplicate #573

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

No branches or pull requests

2 participants