protocolbuffers/protobuf
Ver no GitHubPHP: better debug info for Message objects in protobuf C-extension
Open
#14.872 aberto em 28 de nov. de 2023
help wantedphp
Métricas do repositório
- Stars
- (71.223 stars)
- Métricas de merge de PR
- (Mesclagem média 2d 11h) (185 fundiu PRs em 30d)
Description
See https://github.com/protocolbuffers/protobuf/issues/12714 and https://github.com/protocolbuffers/protobuf/pull/12718, which resolved this problem for the native library.
When the protobuf c-extension is enabled for PHP, calling var_dump on a protobuf message object does not output any useful information:
// Calling var_dump on a Protobuf message (extension enabled):
php > $timestamp = new Google\Protobuf\Timestamp();
php > $timestamp->setSeconds(12345);
php > var_dump($timestamp);
object(Google\Protobuf\Timestamp)#1 (0) {
}
Ideally this would output something like this:
object(Google\Protobuf\Timestamp)#12 (1) {
["seconds"]=>
int(12345)
}