zephir-lang / zephir

Zephir is a compiled high-level language aimed to ease the creation of C-extensions for PHP
https://zephir-lang.com
MIT License
3.29k stars 466 forks source link

I want the ability to call C functions #2439

Open KingBes opened 2 weeks ago

KingBes commented 2 weeks ago

Greeting.zep

namespace Utils;

#include "func.h"

class Greeting
{

    public static function say()
    {
        C.hello();
    }

}

func.h

void hello(){

}
Jeckerson commented 2 weeks ago

You can achieve this via optimizers - https://docs.zephir-lang.com/latest/optimizers/

KingBes commented 2 weeks ago

You can achieve this via optimizers - https://docs.zephir-lang.com/latest/optimizers/

Can this method call the c library?