I'm creating an extension containing the class
namespace ExtABC;
class ClassA
{
public $A1;
public function __construct()
{
}
}
During compilation I get an error
Syntax error in extabc/classb on line 5
public $A1;
------------^
Why the simple property name $A1 can not be used in zephyr?
Property name $A1 is not essential for me, I just wanted to use it in my previous post in this forum. This name has caused an error and instead it I used the name of the property $abc )))
Let's look at another example. Let extension ExtABC contains two classes ClassA and ClassB.
namespace ExtABC;
class ClassA
{
protected $id;
protected $name;
public function __construct()
{
let $this->id = "";
let $this->name = "";
}
public function __get(var $prop)
{
switch ($prop)
{
case "ID":
return $this->id;
case "Name":
return $this->name;
}
}
public function __set(var $prop, var $value)
{
switch ($prop)
{
case "ID":
let $this->id = $value;
break;
case "Name":
let $this->name = $value;
break;
}
}
}
namespace ExtABC;
use ExtABC\ClassA;
class ClassB
{
public function __construct()
{
var $objectA;
let $objectA = new \ExtABC\ClassA();
let $objectA->ID = "objectA";
let $objectA->Name = "objectA";
}
}
During compilation I get an error
Syntax error in extabc/classb on line 10
let $objectA->ID = "objectA";
----------------------^
This already is a very significant error.
So what are the names of class properties and class methods that are acceptable in zephir?