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 the try catch use ParseException: Syntax error

try {
    echo hello;
} catch \Exception e {
    echo e->getMessage();
}

Zephir\ParseException: Syntax error in /alidata/www/mybetdata/mybetdata/data.zep on line 10

             } catch \Exception e {
        ------------------------^


98.9k
Accepted
answer
edited Sep '14

Currently, that syntax is not supported, the right syntax is:

try {
    echo hello;
} catch \Exception, e {
    echo e->getMessage();
}

https://github.com/phalcon/zephir/blob/master/test/trytest.zep#L84

Thank you for