// NewContext creates a new execution context for the active engine and returns
// an error if the execution context failed to initialize at any point. This
// corresponds to PHP's RINIT (request init) phase.
NewContext creates a new execution context for the active engine and returns
an error if the execution context failed to initialize at any point. This
corresponds to PHP's RINIT (request init) phase.
// NewContext creates a new execution context for the active engine and returns // an error if the execution context failed to initialize at any point . This // corresponds to PHP ' s RINIT ( request init ) phase .
func (e *Engine) NewContext() (*Context, error) {
	ptr, err := C.new_context()
	if err != nil {
		return nil, fmt.Errorf("Failed to initialize context for PHP engine" + err.Error())
	}
	ctx := &Context{
		Header:  make(http.Header),
		context: ptr,
		values:  make([]*Value, 0),
	}
	e.contexts[ptr] = ctx
	return ctx, nil
}
func ( e * Engine ) NewContext ( ) ( * Context , error ) { ptr , err := C . new_context ( ) if err != nil { return nil , fmt . Errorf ( " " + err . Error ( ) ) } ctx := & Context { Header : make ( http . Header ) , context : ptr , values : make ( [ ] * Value , 0 ) , } e . contexts [ ptr ] = ctx return ctx , nil }
NewContext creates a new execution context for the active engine and returns
an error if the execution context failed to initialize at any point.
NewContext creates a new execution context for the active engine and returns an error if the execution context failed to initialize at any point .
// Store reference to context, using pointer as key.