feat: better debug info for PHP messages and repeated fields (#12718)
addresses https://github.com/protocolbuffers/protobuf/issues/12714 by dumping more concise debug info for protobuf messages and repeated fields via the `serializeToJsonString` function. Additionally, message types which serialize into something other than an array (e.g. `Google\Protobuf\Value`, `Google\Protobuf\Timestamp`, etc) are handled in a special way to make their output consistent with other messages.
```php
$m = new Google\Protobuf\DoubleValue();
$m->setValue(1.5);
var_dump($m);
```
will output
```
object(Google\Protobuf\DoubleValue)#12 (1) {
["value"]=>
float(1.5)
}
```
Closes #12718
COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/12718 from bshaffer:php-add-debuginfo c40a6f91de08a39d9f66c7c5a5463893edcbedf8
PiperOrigin-RevId: 574115431 B
Brent Shaffer committed
59d5006d6073602675c9d9f418353a566a085658
Parent: d792703
Committed by Copybara-Service <copybara-worker@google.com>
on 10/17/2023, 12:30:15 PM