phpobj

package
v0.0.0-...-60f1d27 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2025 License: BSD-3-Clause Imports: 10 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

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

> class ArrayAccess

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

> class __PHP_Incomplete_Class

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 ThrowException

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

func ThrowObject

func ThrowObject(ctx phpv.Context, v *phpv.ZVal) error

Types

type NativeMethod

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

func (NativeMethod) AsVal

func (m NativeMethod) AsVal(ctx phpv.Context, t phpv.ZType) (phpv.Val, error)

func (NativeMethod) Call

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

func (NativeMethod) GetType

func (m NativeMethod) GetType() phpv.ZType

func (NativeMethod) Name

func (m NativeMethod) Name() string

func (NativeMethod) String

func (m NativeMethod) String() string

func (NativeMethod) Value

func (m NativeMethod) Value() phpv.Val

func (NativeMethod) ZVal

func (m NativeMethod) ZVal() *phpv.ZVal

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
	Implementations []*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
}
var Exception *ZClass

> class Exception

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) GetProp

func (c *ZClass) GetProp(name phpv.ZString) (*phpv.ZClassProp, bool)

func (*ZClass) GetStaticProps

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

func (*ZClass) Handlers

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

func (*ZClass) Implements

func (c *ZClass) Implements(class phpv.ZClass) bool

func (*ZClass) InstanceOf

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

func (*ZClass) NextInstanceID

func (c *ZClass) NextInstanceID() int

func (*ZClass) Run

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

type ZObject

type ZObject struct {
	Class        phpv.ZClass
	CurrentClass phpv.ZClass

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

func CreateZObject

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

Similar to NewZObject, but without calling the constructor

func NewZObject

func NewZObject(ctx phpv.Context, c phpv.ZClass, args ...*phpv.ZVal) (*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(ctx phpv.Context) (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) GetKin

func (z *ZObject) GetKin(className string) phpv.ZObject

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) GetParent

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

func (*ZObject) GetType

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

func (*ZObject) HasProp

func (o *ZObject) HasProp(ctx phpv.Context, key phpv.Val) (bool, error)

func (*ZObject) HashTable

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

func (*ZObject) IterProps

func (o *ZObject) IterProps(ctx phpv.Context) iter.Seq[*phpv.ZClassProp]

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(ctx phpv.Context, 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) Unwrap

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

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