phpobj

package
v0.0.0-...-271b4c5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2018 License: BSD-3-Clause Imports: 6 Imported by: 24

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ArrayAccess = &ZClass{
	Type: phpv.ZClassTypeInterface,
	Name: "ArrayAccess",
}

> class ArrayAccess

View Source
var Exception = &ZClass{
	Name:       "Exception",
	Implements: []*ZClass{Throwable},
	Methods: map[phpv.ZString]*phpv.ZClassMethod{
		"__construct": &phpv.ZClassMethod{Name: "__construct", Method: NativeMethod(exceptionConstruct)},
	},
}

> class Exception

View Source
var Iterator = &ZClass{
	Type:    phpv.ZClassTypeInterface,
	Name:    "Iterator",
	Extends: Traversable,
}

> class Iterator

View Source
var IteratorAggregate = &ZClass{
	Type:    phpv.ZClassTypeInterface,
	Name:    "IteratorAggregate",
	Extends: Traversable,
}

> class IteratorAggregate

View Source
var Serializable = &ZClass{
	Type: phpv.ZClassTypeInterface,
	Name: "Serializable",
}

> class Serializable

View Source
var StdClass = &ZClass{
	Name: "stdClass",
}

> class StdClass

View Source
var Throwable = &ZClass{
	Name: "Throwable",
}

> class Throwable

View Source
var Traversable = &ZClass{
	Type: phpv.ZClassTypeInterface,
	Name: "Traversable",
}

> class Traversable

Functions

func Throw

func Throw(o *ZObject) error

func ThrowException

func ThrowException(ctx phpv.Context, l *phpv.Loc, msg phpv.ZString, code phpv.ZInt) error

Types

type NativeMethod

type NativeMethod func(ctx phpv.Context, this *ZObject, args []*phpv.ZVal) (*phpv.ZVal, error)

func (NativeMethod) Call

func (m NativeMethod) Call(ctx phpv.Context, args []*phpv.ZVal) (*phpv.ZVal, error)

type ZClass

type ZClass struct {
	Name phpv.ZString
	L    *phpv.Loc
	Type phpv.ZClassType
	Attr phpv.ZClassAttr

	// string value of extend & implement (used previous to lookup)
	ExtendsStr    phpv.ZString
	ImplementsStr []phpv.ZString

	Extends     *ZClass
	Implements  []*ZClass
	Const       map[phpv.ZString]phpv.Val // class constants
	Props       []*phpv.ZClassProp
	Methods     map[phpv.ZString]*phpv.ZClassMethod
	StaticProps *phpv.ZHashTable

	// class specific handlers
	H *phpv.ZClassHandlers
	// contains filtered or unexported fields
}

func (*ZClass) BaseName

func (c *ZClass) BaseName() phpv.ZString

func (*ZClass) Compile

func (c *ZClass) Compile(ctx phpv.Context) error

func (*ZClass) Dump

func (c *ZClass) Dump(w io.Writer) error

func (*ZClass) GetMethod

func (c *ZClass) GetMethod(name phpv.ZString) (*phpv.ZClassMethod, bool)

func (*ZClass) GetName

func (c *ZClass) GetName() phpv.ZString

func (*ZClass) GetParent

func (c *ZClass) GetParent() phpv.ZClass

func (*ZClass) GetStaticProps

func (c *ZClass) GetStaticProps(ctx phpv.Context) (*phpv.ZHashTable, error)

func (*ZClass) Handlers

func (c *ZClass) Handlers() *phpv.ZClassHandlers

func (*ZClass) InstanceOf

func (c *ZClass) InstanceOf(subc phpv.ZClass) bool

func (*ZClass) Run

func (c *ZClass) Run(ctx phpv.Context) (*phpv.ZVal, error)

type ZObject

type ZObject struct {
	Class phpv.ZClass

	// for use with custom extension objects
	Opaque map[phpv.ZClass]interface{}
	// contains filtered or unexported fields
}

func NewZObject

func NewZObject(ctx phpv.Context, c phpv.ZClass) (*ZObject, error)

func NewZObjectOpaque

func NewZObjectOpaque(ctx phpv.Context, c phpv.ZClass, v interface{}) (*ZObject, error)

func SpawnException

func SpawnException(ctx phpv.Context, l *phpv.Loc, msg phpv.ZString, code phpv.ZInt, prev *ZObject) (*ZObject, error)

func (*ZObject) AsVal

func (z *ZObject) AsVal(ctx phpv.Context, t phpv.ZType) (phpv.Val, error)

func (*ZObject) Clone

func (z *ZObject) Clone() (phpv.ZObject, error)

func (*ZObject) Count

func (a *ZObject) Count(ctx phpv.Context) phpv.ZInt

func (*ZObject) GetClass

func (a *ZObject) GetClass() phpv.ZClass

func (*ZObject) GetMethod

func (o *ZObject) GetMethod(method phpv.ZString, ctx phpv.Context) (phpv.Callable, error)

func (*ZObject) GetOpaque

func (z *ZObject) GetOpaque(c phpv.ZClass) interface{}

func (*ZObject) GetType

func (z *ZObject) GetType() phpv.ZType

func (*ZObject) HashTable

func (a *ZObject) HashTable() *phpv.ZHashTable

func (*ZObject) NewIterator

func (o *ZObject) NewIterator() phpv.ZIterator

func (*ZObject) ObjectGet

func (o *ZObject) ObjectGet(ctx phpv.Context, key phpv.Val) (*phpv.ZVal, error)

func (*ZObject) ObjectSet

func (o *ZObject) ObjectSet(ctx phpv.Context, key phpv.Val, value *phpv.ZVal) error

func (*ZObject) OffsetSet

func (o *ZObject) OffsetSet(key, value *phpv.ZVal) (*phpv.ZVal, error)

func (*ZObject) SetOpaque

func (z *ZObject) SetOpaque(c phpv.ZClass, v interface{})

func (*ZObject) String

func (a *ZObject) String() string

func (*ZObject) Value

func (a *ZObject) Value() phpv.Val

func (*ZObject) ZVal

func (z *ZObject) ZVal() *phpv.ZVal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL