We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Zephir: Syntax error when use extends and implements

Hi guys. I use zephir for writing some extension. I encountered a problem that the parser generates an error when I extends from the other class and implements an interface

namespace Igor;

abstract class MyClassA
{
   // some methods here
}
namespace Igor;

interface MyInterfaceB
{
 // some methods here
}
namespace Igor;

abstract class MyClassC extends Igor\MyClassA implements Igor\MyInterfaceB
{
 // methods here
}

p.s. if in this class not use "abstract" then all works fine.

error:

ParseException: Syntax error in ....myclassc.zep

abstract class MyClassC extends Igor\MyClassA implements Igor\MyInterfaceB
-----------------------------------------------------^

Have ideas?



98.9k

Could you please report this on the Zephir repo?

edited Jun '16

Should you not do:

abstract class MyClassC extends MyClassA implements MyInterfaceB

since you are already in the Igor namespace? Or use \Igor\MyClassA instead (slash in front).