deuill / go-php

PHP bindings for the Go programming language (Golang)
MIT License
930 stars 105 forks source link

Get or set value to the php script in go . #6

Closed xulei8 closed 8 years ago

xulei8 commented 8 years ago

We need put or get values to php script in golang .

deuill commented 8 years ago

You can bind Go variables (except for functions and method receivers) into PHP using the Context.Bind method. Transformation rules are covered in the value.New preamble.

You can return PHP variables for use in the Go context using Context.Eval, which returns a non-nil *Value type if the eval'd string returns anything.

deuill commented 8 years ago

As an aside, the included tests are usually a good example of how the code is supposed to be used. For example, binding Go variables to PHP contexts here.

deuill commented 8 years ago

Closing this as already implemented, please open a new issue if there's some missing functionality here.