We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

Is supported "Include" statement on Zephir ?

I'm trying the Zephir compiler out. Is supported "include" statement ?

my Zephir code is..

namespace Dumy;
final class Mage{
    public static function renderHtml(){

but, it doesn't work.

$ zephir compile

Warning: Function "include" does not exist at compile time in /var/www/magento/temp/dumy/dumy/mage.zep on 5 [nonexistant-function]



No, "include" is not supported, "require" will be supported but it is still not implemented

edited Jan '18

Seems require is still not implemented :s, needed for an RPC thing im doing.. there is a work-around.

Use eval()

    // load and eval class (include, require not supported "yet")
    var src = file_get_contents("/path/to/file.php");
    eval("?>" . src);

Whoops, sorry maybe wrong forum, came from a google search zephir include php