also stringify numbers

This commit is contained in:
Shish 2023-01-28 23:41:44 +00:00
parent 215b30dfca
commit d70f68099f

View file

@ -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();
}