p

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2019 License: MIT Imports: 16 Imported by: 0

README

XGo/p

Tricking implements for php runtime functions

[TOC]

所有函数列表 => GoWalker

Sample

Dumper
aInt := 1
bStr := `sf`
cMap := map[string]interface{}{"name": "z", "age": 14}
dArray := []interface{}{&cMap, aInt, bStr}
c := cMap

p.Dump(aInt, &aInt, &bStr, bStr, cMap, dArray, c, cMap["name"], dArray[2], dArray[aInt])

已知问题

  • compact 目前只支持一行调一次
    • 目前定位调用代码是通过行号和函数名,所以只支持一行一个

todo

  • 获取函数签名
  • ClassLoader
  • Functional http API
  • JSON-RPC

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MaxSliceLen = 32
	MaxMapLen   = 32

	SepKv = " => "

	Out io.Writer = os.Stdout

	//
	StringQuota = `"`
)

Functions

func Compact

func Compact(args ...interface{}) (paramNames []string, paramAndValues map[string]interface{})

Compact 将多个变量打包到一个字典里 a,b:=1,2 Comapct(a, b) => {"a":1,"b":2} 参考自 http://php.net/manual/zh/function.compact.php

func DD

func DD(args ...interface{})

DD means Dump and Die

func DepthCompact

func DepthCompact(depth int, args ...interface{}) (paramNames []string, paramAndValues map[string]interface{})

func DepthDump

func DepthDump(depth int, args ...interface{})

func Dump

func Dump(args ...interface{})

Deprecated use dump.Dump

func G

func G() *rwmap

G 获取当前协程内的全局变量 参考自 http://php.net/manual/zh/reserved.variables.globals.php

func GetExprName

func GetExprName(expr ast.Expr) (name string)

GetExprName 获取一个表达式的名字

func GoID

func GoID() int

GoID 获取当前 Goroutine 的 ID

func IsScala

func IsScala(v interface{}) bool

简单类型

func VarName

func VarName(args ...interface{}) []string

VarName 用来获取变量的名字 VarName(a, b) => []string{"a", "b"}

Types

This section is empty.

Jump to

Keyboard shortcuts

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