MCPcopy Create free account
hub / github.com/php/frankenphp / CValue

Method CValue

internal/extgen/nodes.go:81–93  ·  view source on GitHub ↗

CValue returns the constant value in C-compatible format

()

Source from the content-addressed store, hash-verified

79
80// CValue returns the constant value in C-compatible format
81func (c phpConstant) CValue() string {
82 if c.PhpType != phpInt {
83 return c.Value
84 }
85
86 if strings.HasPrefix(c.Value, "0o") {
87 if val, err := strconv.ParseInt(c.Value, 0, 64); err == nil {
88 return strconv.FormatInt(val, 10)
89 }
90 }
91
92 return c.Value
93}

Callers 2

TestPHPConstantCValueFunction · 0.80

Calls

no outgoing calls

Tested by 2

TestPHPConstantCValueFunction · 0.64