// New initializes a PHP engine instance on which contexts can be executed. It
// corresponds to PHP's MINIT (module init) phase.
New initializes a PHP engine instance on which contexts can be executed. It
corresponds to PHP's MINIT (module init) phase.
// New initializes a PHP engine instance on which contexts can be executed . It // corresponds to PHP ' s MINIT ( module init ) phase .
func New() (*Engine, error) {
	if engine != nil {
		return nil, fmt.Errorf("Cannot activate multiple engine instances")
	}
	ptr, err := C.engine_init()
	if err != nil {
		return nil, fmt.Errorf("PHP engine failed to initialize")
	}
	engine = &Engine{
		engine:    ptr,
		contexts:  make(map[*C.struct__gophp_context]*Context),
		receivers: make(map[string]*Receiver),
	}
	return engine, nil
}
func New ( ) ( * Engine , error ) { if engine != nil { return nil , fmt . Errorf ( " " ) } ptr , err := C . engine_init ( ) if err != nil { return nil , fmt . Errorf ( " " ) } engine = & Engine { engine : ptr , contexts : make ( map [ * C . struct__gophp_context ] * Context ) , receivers : make ( map [ string ] * Receiver ) , } return engine , nil }
New initializes a PHP engine instance on which contexts can be executed.
New initializes a PHP engine instance on which contexts can be executed .