On 3-6-2021 17:53, Ayesh Karunaratne wrote:
Hi Timon,
Thank you for this RFC. I think the `string|int $indent` approach is great 🚀!
Reading the PR, it looks like `$indent=0` is essentially turning off
pretty-print, which I think is intuitive.
Basically, yes. With `$indent=0`, no indentation will take place but new
lines will still be added.
Do you plan to add any sort of validation on negative integers?
Perhaps throw a `\ValueError` exception on $indent < 0?
Good question. Personally I'd prefer clamping $indent to 0 when it
reaches below 0. But I'd like
to hear about what other particpants think about such behavior.
Thank you for your feedback :).
--
Kind regards,
Timon de Groot
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php