Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

parse error with stdclass object

I'm getting this error

Zephir\ParseException: Syntax error in /home/phptozephir/app/app/controller.zep on line 9

        let this->site->url = "http://url";
-----------------------^
namespace App;

class Controller
{
    public site;
    public function __construct(di) -> void
    {
        let this->site =  new \stdClass();
        let this->site->url = "http://url";
        let this->site->active =  "active";
        let this->site->theme = "/theme";
        let this->site->space = "42 GB ";
    }
}


5.8k
Accepted
answer

try

namespace App;

class Controller
{
    public site;
    public function __construct(di) -> void
    {
        var site;

        let site =  new \stdClass(),
            site->url = "http://url",
            site->active =  "active",
            site->theme = "/theme",
            site->space = "42 GB ",

        let this->site = site;
    }
}


1.0k

it works thanks