facebook / facebook/hhvm

Printing non-serializable classes in the debugger says they're null

Open
#3,829 0 comments 0 reactions 1 assignee Claimed by @paulbiss View on GitHub
Dominant language
C++
Stars
18.7k
Forks
3.1k
Avg merge
1h 47m
Merged PRs (30d)
2

Description

```
hphpd> $x = new ReflectionFunction('mb_ereg_replace')
hphpd> p $x
null
hphpd> p (string) $x
"/**\n * @param mixed \$pattern - The regular expression pattern. Multibyte\n * characters may be used in pattern.\n * @param string \$replacement - The replacement text.\n * @param string \$str - The string being checked.\n * @param string \$option - Matching condition can be set by option parameter.\n * If i is specified for this parameter, the case will be ignored. If x is\n * specified, white space will be ignored. If m is specified, match will be\n * executed in multiline mode and line break will be included in '.'. If p is\n * specified, match will be executed in POSIX mode, line break will be\n * considered as normal character. If e is specified, replacement string will\n * be evaluated as PHP expression.\n *\n * @return mixed - The resultant string on success, or FALSE on error.\n *\n */\nFunction [ function mb_ereg_replace ] {\n @@ /home/fredemmott/systemlib.phpmbstring 288 - 291\n\n - Parameters [4] {\n Parameter #0 [ HH\\mixed \$pattern ]\n Parameter #1 [ HH\\string \$replacement ]\n Parameter #2 [ HH\\string \$str ]\n Parameter #3 [ HH\\mixed or NULL \$option = NULL ]\n }\n}\n"
hphpd> =$x
wire error: a:1:{s:1:"_";O:18:"ReflectionFunction":2:{s:27:"
...(omitted)
hphpd> serialize($x)

Warning: Attempted to serialize unserializable builtin class ReflectionFunction
hpmhpd>
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.