-
Notifications
You must be signed in to change notification settings - Fork 15.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support byteSize() in PHP's C implementation #10184
Comments
Has Looking at the code, I don't believe it was ever implemented for C, and I'm not sure it was intended to be exposed as a public API. Can you paste the command that triggered the segfault? |
Good question. I don't have memory about that either. Actually, what I need here is whether the message is empty (have no fields set at all). It's available in some forms in Java and .NET. If we shouldn't rely on this method, do you have alternatives? |
Any updates please? |
I think For now probably the simplest thing is to serialize the proto and test whether the serialized string is empty. |
For BTW, I try to use the I begin to wonder why the implementations of the two versions are quite different. Do we have any unit tests to ensure that they'll be closely aligned? Or is that not a goal at first? |
We can use this issue.
It is definitely a goal for the two implementations to have the same public API. This does not apply to anything in an Internal namespace, but for public APIs it is a goal to keep them the same. The majority of our unit tests are run against both implementations, to ensure that there is a single public API for both. The only exception is https://github.com/protocolbuffers/protobuf/blob/main/php/tests/PhpImplementationTest.php which is only run against the pure-PHP implementation. I believe that |
Thanks.
Sorry that I wasn't clear. Our users use both implementations so all features must be supported in both versions. |
I will get you something for |
Thanks! |
I see your PR is merged. When will this be included in the PECL extension? |
We are planning to do a release this week. |
Thanks. Will wait for that. |
We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please add a comment. This issue is labeled |
We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please reopen it. This issue was closed and archived because there has been no new activity in the 14 days since the |
What version of protobuf and what language are you using?
Version: 3.21.2 (installed via PECL)
Language: PHP
What operating system (Linux, Windows, ...) and version?
Linux
What runtime / compiler are you using (e.g., python version or gcc version)
N/A
What did you do?
Do the following and I get
Error: Call to undefined method Google\Ads\GoogleAds\V11\Resources\Campaign::byteSize()
:Same for
jsonByteSize()
.What did you expect to see
Some numbers printed.
What did you see instead?
Error: Call to undefined method Google\Ads\GoogleAds\V11\Resources\Campaign::byteSize()
:Anything else we should know about your project / environment
I use google-ads-php, but I believe it would occur to any object created.
This error doesn't occur when I use the PHP implementation installed by Composer.
Besides, when I installed (updated) the extension using
pecl
, there was asegmentation fault
:The text was updated successfully, but these errors were encountered: