CValue returns the constant value in C-compatible format
()
| 79 | |
| 80 | // CValue returns the constant value in C-compatible format |
| 81 | func (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 | } |
no outgoing calls