php-zephir-parser
php-zephir-parser copied to clipboard
Compilation error on accessing dynamic properties
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: phalcon/zephir#684
From @steffengy on December 14, 2014 14:54
Probably related to some limitations like here: https://github.com/phalcon/zephir/issues/573
From @SliceOfLife on December 14, 2014 15:8
Yes, you are right.