also stringify numbers
This commit is contained in:
parent
215b30dfca
commit
d70f68099f
1 changed files with 3 additions and 0 deletions
|
@ -808,6 +808,9 @@ function stringer($s): string
|
|||
if (is_string($s)) {
|
||||
return "\"$s\""; // FIXME: handle escaping quotes
|
||||
}
|
||||
if (is_numeric($s)) {
|
||||
return "$s";
|
||||
}
|
||||
if (method_exists($s, "__toString")) {
|
||||
return $s->__toString();
|
||||
}
|
||||
|
|
Reference in a new issue