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.3k stars 466 forks source link

I want the ability to call C functions #2439

Open KingBes opened 1 month ago

KingBes commented 1 month ago

Greeting.zep

namespace Utils;

#include "func.h"

class Greeting
{

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

}

func.h

void hello(){

}
Jeckerson commented 1 month ago

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

KingBes commented 1 month ago

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

Can this method call the c library?