Documentation
¶
Index ¶
- Constants
- Variables
- func CallbackErrorReason(err error) string
- func Deref[T any](ptr *T, defValue T) T
- func Eval(ctx phpv.Context, expr string) (*phpv.ZVal, error)
- func Every[T any](xs []T, predicate func(T) bool) bool
- func Expand(ctx phpv.Context, args []*phpv.ZVal, out ...interface{}) (int, error)
- func ExpandAt(ctx phpv.Context, args []*phpv.ZVal, i int, out interface{}) error
- func Idx[T any](xs []T, i int, defaultVal ...T) T
- func IfElse[T any](cond bool, consequence, alternative T) T
- func IterateBackwards[T any](xs []T) iter.Seq2[int, T]
- func SpawnCallable(ctx phpv.Context, v *phpv.ZVal) (phpv.Callable, error)
- func SpawnCallableParam(ctx phpv.Context, v *phpv.ZVal, paramNo int) (phpv.Callable, error)
- func StrIdx(str string, i int, defaultVal ...byte) byte
- func ZFprintf(ctx phpv.Context, w printfWriter, format phpv.ZString, arg ...*phpv.ZVal) (int, error)
- func Zprintf(ctx phpv.Context, fmt phpv.ZString, arg ...*phpv.ZVal) (*phpv.ZVal, error)
- func Zscanf(ctx phpv.Context, r io.Reader, format phpv.ZString, args ...*phpv.ZVal) (*phpv.ZVal, error)
- type Optional
- func (o *Optional[T]) AsVal(ctx phpv.Context, t phpv.ZType) (phpv.Val, error)
- func (o *Optional[T]) Get() T
- func (o *Optional[T]) GetOrDefault(defaultVal T) T
- func (o *Optional[T]) GetType() phpv.ZType
- func (or *Optional[T]) HasArg() bool
- func (o *Optional[T]) Set(v T)
- func (o *Optional[T]) String() string
- func (o *Optional[T]) Value() phpv.Val
- func (o *Optional[T]) ZVal() *phpv.ZVal
- type OptionalRef
- type Ref
Constants ¶
View Source
const ( ASSERT_ACTIVE phpv.ZInt = 1 ASSERT_WARNING phpv.ZInt = 2 ASSERT_CALLBACK phpv.ZInt = 3 ASSERT_BAIL phpv.ZInt = 4 ASSERT_QUIET phpv.ZInt = 5 ASSERT_EXCEPTION phpv.ZInt = 6 )
PHP assert option constants
View Source
const ( COUNT_NORMAL phpv.ZInt = iota COUNT_RECURSIVE )
> const
View Source
const ( TRUE = phpv.ZBool(true) FALSE = phpv.ZBool(false) ZEND_THREAD_SAFE = phpv.ZBool(true) // consider things thread safe PHP_ZTS = phpv.ZInt(1) PHP_DEBUG = phpv.ZInt(0) DEFAULT_INCLUDE_PATH = phpv.ZString(".:") DIRECTORY_SEPARATOR = phpv.ZString("/") PHP_EOL = phpv.ZString("\n") PHP_INT_MAX = phpv.ZInt(math.MaxInt64) PHP_INT_MIN = phpv.ZInt(math.MinInt64) PHP_INT_SIZE = phpv.ZInt(8) // standard values PHP_FD_SETSIZE = phpv.ZInt(1024) PHP_MAXPATHLEN = phpv.ZInt(4096) PHP_FLOAT_DIG = phpv.ZInt(15) PHP_FLOAT_EPSILON = phpv.ZFloat(2.220446049250313e-16) PHP_FLOAT_MAX = phpv.ZFloat(math.MaxFloat64) PHP_FLOAT_MIN = phpv.ZFloat(math.SmallestNonzeroFloat64) PATH_SEPARATOR = phpv.ZString(":") // Seek constants SEEK_SET = phpv.ZInt(0) SEEK_CUR = phpv.ZInt(1) SEEK_END = phpv.ZInt(2) E_ERROR = phpv.ZInt(phpv.E_ERROR) E_WARNING = phpv.ZInt(phpv.E_WARNING) E_PARSE = phpv.ZInt(phpv.E_PARSE) E_NOTICE = phpv.ZInt(phpv.E_NOTICE) E_CORE_ERROR = phpv.ZInt(phpv.E_CORE_ERROR) E_CORE_WARNING = phpv.ZInt(phpv.E_CORE_WARNING) E_COMPILE_ERROR = phpv.ZInt(phpv.E_COMPILE_ERROR) E_COMPILE_WARNING = phpv.ZInt(phpv.E_COMPILE_WARNING) E_USER_ERROR = phpv.ZInt(phpv.E_USER_ERROR) E_USER_WARNING = phpv.ZInt(phpv.E_USER_WARNING) E_USER_NOTICE = phpv.ZInt(phpv.E_USER_NOTICE) E_STRICT = phpv.ZInt(phpv.E_STRICT) E_RECOVERABLE_ERROR = phpv.ZInt(phpv.E_RECOVERABLE_ERROR) E_DEPRECATED = phpv.ZInt(phpv.E_DEPRECATED) E_USER_DEPRECATED = phpv.ZInt(phpv.E_USER_DEPRECATED) E_ALL = phpv.ZInt(phpv.E_ALL) )
> const
View Source
const ( DEBUG_BACKTRACE_PROVIDE_OBJECT = phpv.ZInt(1) DEBUG_BACKTRACE_IGNORE_ARGS = phpv.ZInt(2) )
> const
View Source
const ( PHP_OS = phpv.ZString(runtime.GOOS) PHP_OS_FAMILY = phpv.ZString(runtime.GOOS) )
> const
View Source
const ( PHP_VERSION = phpv.ZString(VERSION) // version of PHP PHP_MAJOR_VERSION = phpv.ZInt(8) PHP_MINOR_VERSION = phpv.ZInt(2) PHP_RELEASE_VERSION = phpv.ZInt(0) PHP_EXTRA_VERSION = phpv.ZString("") PHP_VERSION_ID = phpv.ZInt(80200) )
> const
View Source
const VERSION = "8.2.0"
php targetted version
Variables ¶
View Source
var ErrNotEnoughArguments = errors.New("Too few arguments")
View Source
var NULL = phpv.ZNull{}
> const
Functions ¶
func CallbackErrorReason ¶
CallbackErrorReason extracts the reason portion from a SpawnCallable error. SpawnCallable errors are typically formatted as:
"funcName(): Argument #N ($callback) must be a valid callback, <reason>"
This function returns just the "<reason>" part for re-wrapping by callers. If the error is not a callback error, it returns the full error string.
func SpawnCallableParam ¶
func ZFprintf ¶
func ZFprintf(ctx phpv.Context, w printfWriter, format phpv.ZString, arg ...*phpv.ZVal) (int, error)
Zprintf implements printf with zvals
Types ¶
type Optional ¶
func (*Optional[T]) GetOrDefault ¶
func (o *Optional[T]) GetOrDefault(defaultVal T) T
type OptionalRef ¶
func (*OptionalRef[T]) GetOrDefault ¶
func (or *OptionalRef[T]) GetOrDefault(defaultVal T) T
func (*OptionalRef[T]) HasArg ¶
func (or *OptionalRef[T]) HasArg() bool
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package locale provides a pure-Go emulation of POSIX setlocale/localeconv/ nl_langinfo for PHP.
|
Package locale provides a pure-Go emulation of POSIX setlocale/localeconv/ nl_langinfo for PHP. |
|
Package phpv contains all required types and interfaces for storing Goro values, context or compiled PHP code.
|
Package phpv contains all required types and interfaces for storing Goro values, context or compiled PHP code. |
|
Package vm implements a stack-based bytecode virtual machine for Goro that runs in parallel to the AST tree-walking executor in core/compiler.
|
Package vm implements a stack-based bytecode virtual machine for Goro that runs in parallel to the AST tree-walking executor in core/compiler. |
|
vmcompiler
Package vmcompiler walks a compiled AST tree (phpv.Runnable) and emits a *vm.Function that the VM can execute.
|
Package vmcompiler walks a compiled AST tree (phpv.Runnable) and emits a *vm.Function that the VM can execute. |
Click to show internal directories.
Click to hide internal directories.