Background
Because Protocolbuffers is being used in the project, the extension used throughout the project has basically been supported by PHP7, and only protocolbuffers this does not support PHP7, the original author has stopped maintaining the extension, But I can only begin to study how to upgrade the 5.x version of the protocolbuffers extension to PHP7. Currently the extension can be compiled. GitHub
The make test results are as follows:
Number of tests : 144 144Tests skipped : 0 ( 0.0%) --------Tests warned : 0 ( 0.0%) ( 0.0%)Tests failed : 67 ( 46.5%) ( 46.5%)Expected fail : 0 ( 0.0%) ( 0.0%)Tests passed : 77 ( 53.5%) ( 53.5%)
Problems encountered
The following is the test code:
setValue(0);$obj = ProtocolBuffers::decode("Tutorial_Integer32", $bytes);var_dump($obj);if ($obj instanceof Tutorial_Integer32) { var_dump($obj->getValue()); if ($obj->getValue() == 0) { echo "OK" . PHP_EOL; } else { var_dump($obj); }} else { var_dump($obj);}ini_set("protocolbuffers.native_scalars", 1);$obj = ProtocolBuffers::decode("Tutorial_Integer32", $bytes);if ($obj instanceof Tutorial_Integer32) { var_dump($obj->getValue()); if ($obj->getValue() === 0) { echo "OK" . PHP_EOL; } else { var_dump($obj); }} else { var_dump($obj);}
The output results are as follows:
object(Tutorial_Integer32)#2 (2) { ["_properties":protected]=> array(0) { } ["value":protected]=> string(1) "0"}NULLOKNULLobject(Tutorial_Integer32)#3 (2) { ["_properties":protected]=> array(0) { } ["value":protected]=> int(0)}
Summary of the problem: when Protocolbuffers::d Ecode, the parsed object can be returned, but the object's properties cannot be read. Solution in ...
Reply content:
Background
Because Protocolbuffers is being used in the project, the extension used throughout the project has basically been supported by PHP7, and only protocolbuffers this does not support PHP7, the original author has stopped maintaining the extension, But I can only begin to study how to upgrade the 5.x version of the protocolbuffers extension to PHP7. Currently the extension can be compiled. GitHub
The make test results are as follows:
Number of tests : 144 144Tests skipped : 0 ( 0.0%) --------Tests warned : 0 ( 0.0%) ( 0.0%)Tests failed : 67 ( 46.5%) ( 46.5%)Expected fail : 0 ( 0.0%) ( 0.0%)Tests passed : 77 ( 53.5%) ( 53.5%)
Problems encountered
The following is the test code:
setValue(0);$obj = ProtocolBuffers::decode("Tutorial_Integer32", $bytes);var_dump($obj);if ($obj instanceof Tutorial_Integer32) { var_dump($obj->getValue()); if ($obj->getValue() == 0) { echo "OK" . PHP_EOL; } else { var_dump($obj); }} else { var_dump($obj);}ini_set("protocolbuffers.native_scalars", 1);$obj = ProtocolBuffers::decode("Tutorial_Integer32", $bytes);if ($obj instanceof Tutorial_Integer32) { var_dump($obj->getValue()); if ($obj->getValue() === 0) { echo "OK" . PHP_EOL; } else { var_dump($obj); }} else { var_dump($obj);}
The output results are as follows:
object(Tutorial_Integer32)#2 (2) { ["_properties":protected]=> array(0) { } ["value":protected]=> string(1) "0"}NULLOKNULLobject(Tutorial_Integer32)#3 (2) { ["_properties":protected]=> array(0) { } ["value":protected]=> int(0)}
Summary of the problem: when Protocolbuffers::d Ecode, the parsed object can be returned, but the object's properties cannot be read. Solution in ...