- My code is ....
public static function register(key, value, graceful = false)
{
var _tmp; let _tmp = self::_registry[key];
if (isset(_tmp)) {
if (graceful) {
return;
}
self::throwException("Mage registry key "" . key . "" already exists");
}
self::_registry[key] = value;
}
OR:
public static function register(key, value, graceful = false)
{
if fetch val, self::_registry[key]{
if (graceful) {
return;
}
self::throwException("Mage registry key "" . key . "" already exists");
}
self::_registry[key] = value;
}
ParseException: Syntax error in /var/www/magento/shell/zephir/dumy/dumy/mage.zep on line 116
let _tmp = self::_registry[key];
-------------------------------^
Why is syntax error ?
- My code is.......
final class Mage
{
private static _registry = [];
......................
}
ParseException: Syntax error in /var/www/magento/shell/zephir/dumy/dumy/mage.zep on line 10
private static _registry = [];
-------------------------------^
why is syntax error ? Is it impossible array init with variable declaration ?