php: fix dumping of arrays with integers

Python `join()` function only handles strings. We need to ensure that
we only provide strings.