Skip to content
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

PHP package error #2359

Closed
jasonhe88 opened this issue Nov 12, 2016 · 1 comment
Closed

PHP package error #2359

jasonhe88 opened this issue Nov 12, 2016 · 1 comment

Comments

@jasonhe88
Copy link

php 7.0.12

the simple msg.proto file for testing:

syntax="proto3";

message Msg {
        uint32 mid  = 1;
        string body = 2;
}

then try to run following php code:

<?php

require_once("./vendor/autoload.php");
require_once("./msg.pb.php");

$msg = new Msg();

?>

get following error:

PHP Notice: Undefined index: Msg in /home/jasonhe/CS/vendor/google/protobuf/php/src/Google/Protobuf/Internal/DescriptorPool.php on line 109

Notice: Undefined index: Msg in /home/jasonhe/CS/vendor/google/protobuf/php/src/Google/Protobuf/Internal/DescriptorPool.php on line 109
PHP Fatal error: Uncaught Error: Call to a member function getField() on null in /home/jasonhe/CS/vendor/google/protobuf/php/src/Google/Protobuf/Internal/Message.php:75
Stack trace:
#0 /home/jasonhe/CS/msg.pb.php(171): Google\Protobuf\Internal\Message->__construct()
#1 /home/jasonhe/CS/tt.php(4): require_once('/home/jasonhe/C...')
#2 {main}
thrown in /home/jasonhe/CS/vendor/google/protobuf/php/src/Google/Protobuf/Internal/Message.php on line 75

Fatal error: Uncaught Error: Call to a member function getField() on null in /home/jasonhe/CS/vendor/google/protobuf/php/src/Google/Protobuf/Internal/Message.php:75
Stack trace:
#0 /home/jasonhe/CS/msg.pb.php(171): Google\Protobuf\Internal\Message->__construct()
#1 /home/jasonhe/CS/tt.php(4): require_once('/home/jasonhe/C...')
#2 {main}
thrown in /home/jasonhe/CS/vendor/google/protobuf/php/src/Google/Protobuf/Internal/Message.php on line 75

@TeBoring
Copy link
Contributor

I think this has been fixed in the master branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants